how to save a file into MS Access Table...
-
hi.. everybody.. hope you can help me with this thing. Do you have any idea, how to save a file into MS Access database using VB 2005? Here's the simple scheme of the table FieldName {Data Type} -------------------------- Date {Date} EmployeeID {Number/Integer} Attachment {OLE Object} -------------------------- I red the MSDN help, but still haven't any idea how to apply it into my case. Or should i make an array of bytes stream of the file and then store it into 'Attachment' field. But then how the to read and restore/create the file back? Thanks before..
-
hi.. everybody.. hope you can help me with this thing. Do you have any idea, how to save a file into MS Access database using VB 2005? Here's the simple scheme of the table FieldName {Data Type} -------------------------- Date {Date} EmployeeID {Number/Integer} Attachment {OLE Object} -------------------------- I red the MSDN help, but still haven't any idea how to apply it into my case. Or should i make an array of bytes stream of the file and then store it into 'Attachment' field. But then how the to read and restore/create the file back? Thanks before..
I haven't done anything like this with access, but with another database I declared a column of type blob....which essentially IS an array of bytes. That way I could store any type of file (.pdf, .jpg, .gif,...) Perhaps searching for information using the keyword "blob" will help you. Sorry i couldn't be more helpful.
-
hi.. everybody.. hope you can help me with this thing. Do you have any idea, how to save a file into MS Access database using VB 2005? Here's the simple scheme of the table FieldName {Data Type} -------------------------- Date {Date} EmployeeID {Number/Integer} Attachment {OLE Object} -------------------------- I red the MSDN help, but still haven't any idea how to apply it into my case. Or should i make an array of bytes stream of the file and then store it into 'Attachment' field. But then how the to read and restore/create the file back? Thanks before..
This is an image file? Do you want to embed them in the database or create a link to them? OLE Object fields can be set to embed or link to an image or other OLE file such as a Word document or Excel workbook. Embedding an image (especially GIF and JPEG) will cause the size of the database to grow far beyond the size of the image files you embed and may cause the database to run much slower. Part of the reason is that Access creates a bitmap (bmp) of the image for display information purposes. Also, If users are using Access forms, they will need additional software to view images other than bitmap (.bmp) or device independent bitmap (.dib) files on a standard Windows installation. If the OLE Object field in the database is set to 'Link' instead of 'Embed' then all you need to do is store the path to the file. Steve
-
I haven't done anything like this with access, but with another database I declared a column of type blob....which essentially IS an array of bytes. That way I could store any type of file (.pdf, .jpg, .gif,...) Perhaps searching for information using the keyword "blob" will help you. Sorry i couldn't be more helpful.
-
This is an image file? Do you want to embed them in the database or create a link to them? OLE Object fields can be set to embed or link to an image or other OLE file such as a Word document or Excel workbook. Embedding an image (especially GIF and JPEG) will cause the size of the database to grow far beyond the size of the image files you embed and may cause the database to run much slower. Part of the reason is that Access creates a bitmap (bmp) of the image for display information purposes. Also, If users are using Access forms, they will need additional software to view images other than bitmap (.bmp) or device independent bitmap (.dib) files on a standard Windows installation. If the OLE Object field in the database is set to 'Link' instead of 'Embed' then all you need to do is store the path to the file. Steve
It will be pdf or ms office files. I want to embed it to the database. Here i tell you the concept we want to meet to: We have several teams on the field. And those team will use and report the data using that database. So for this purpose, i create the replica set. Frequently, they have to submit the pre-formated report in office(doc,xls,ppt) and pdf. The teams report once every month. So all they have to do is just to send the database file and at HQ team will syncronize the database and send it back to the field. I never use OLE object, so it possible to store array of byte into it? Is it take more space? ty:)
-
It will be pdf or ms office files. I want to embed it to the database. Here i tell you the concept we want to meet to: We have several teams on the field. And those team will use and report the data using that database. So for this purpose, i create the replica set. Frequently, they have to submit the pre-formated report in office(doc,xls,ppt) and pdf. The teams report once every month. So all they have to do is just to send the database file and at HQ team will syncronize the database and send it back to the field. I never use OLE object, so it possible to store array of byte into it? Is it take more space? ty:)
-
Wow... i just found it... Just take a line of code to read a file into an array of bytes, and a line for write the bytes array into a file... ty Microsoft ;P
If the column contains an array of bytes, I'm not sure Access will display the file. I think you would need code to extract the bytes to a file again. Also, you may want to try a few examples because, as I said, embedding files in Access (especially images) increases the file size by a huge amount. THis may not be the case with an array of bites... Steve
-
If the column contains an array of bytes, I'm not sure Access will display the file. I think you would need code to extract the bytes to a file again. Also, you may want to try a few examples because, as I said, embedding files in Access (especially images) increases the file size by a huge amount. THis may not be the case with an array of bites... Steve
I use ReadAllBytes and WriteAllBytes built-in functions Form Systems.IO namespace. The size is ok. :)