EFileTahi-A
Contributor
Ok (deep breath)...
I'm using this Software called "Card Five" to print credit-card like cards. It uses an access database to retrieve information, name and a photo.
I made an application to add automatically all photos to the access database (the fotos have the same name as the persons ID). My program works great and already have added all photos to the dabase. Unfortunately, when I use Card-Five program to get the images from the access database the program shows nothing in the preview box (a 50x50 label which normally would show the photo).
When I manually add a picture using Card-Five (browing the folders and selecting a picture file) it works great. The minute I use my proggie to add the pictures Card-Five simply refuses the show me anything. The only thing it shows is a white image with some black text saying: "Picture Format".
I've checked the type of data stored in the access database from both Card-Five and my application and they are defined as "Long-Binary-Format" in a OLE Object type field.
This is the code I'm using to insert the images on the database:
Does anyone have a clue of what is happening? Is there any other way to add images to the Access data base? Is there any special Parameter I can supply with to walk around or at least to try to walk around the problem?
Thank you so very much if you really have a suggestion.
I'm using this Software called "Card Five" to print credit-card like cards. It uses an access database to retrieve information, name and a photo.
I made an application to add automatically all photos to the access database (the fotos have the same name as the persons ID). My program works great and already have added all photos to the dabase. Unfortunately, when I use Card-Five program to get the images from the access database the program shows nothing in the preview box (a 50x50 label which normally would show the photo).
When I manually add a picture using Card-Five (browing the folders and selecting a picture file) it works great. The minute I use my proggie to add the pictures Card-Five simply refuses the show me anything. The only thing it shows is a white image with some black text saying: "Picture Format".
I've checked the type of data stored in the access database from both Card-Five and my application and they are defined as "Long-Binary-Format" in a OLE Object type field.
This is the code I'm using to insert the images on the database:
Code:
MemoryStream ms = new MemoryStream();
bmpFile.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp);
string sSQLQuery = "UPDATE " + this.txt_tableName.Text + " SET " + this.cbx_imagesField.Text +
" = (?)";
OleDbCommand cmd = new OleDbCommand(sSQLQuery, cCon);
try
{
byte[] binContent = ms.ToArray();
OleDbParameter imageParameter = cmd.Parameters.Add("@Picture", OleDbType.Binary);
imageParameter.Value = binContent;
imageParameter.Size = binContent.Length;
sSQLQuery += " WHERE " + this.cbx_IDField.Text + " = " + sFileName;
//MessageBox.Show(cmd.CommandText);
cmd.CommandText = sSQLQuery;
cmd.ExecuteNonQuery();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
cmd.Dispose();
Does anyone have a clue of what is happening? Is there any other way to add images to the Access data base? Is there any special Parameter I can supply with to walk around or at least to try to walk around the problem?
Thank you so very much if you really have a suggestion.
Last edited: