LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

I am using the SQL toolkit in LabWindows to save results in a MS Access database. How can I insert an OLE object into an Access data field using the SQL toolkit?

You should be able to store the bitmap file in a record with an Ole Object data type as a binary file. To do this you use the DBPutColBinary function. To get the gist of how to use the function you should look at the example code immediately following the functions description in the SQL toolkit manual. I actually have some simple source code here that was created awhile back for writing the data for a .jpg in binary form to a database, and I have included it for you to look at. Just note that you will have to specify a different string for the call to DBConnect so that you connect to your database properly, also remember to set the datatype of the record to Ole Object in your database, and that the file name for the .jpg file should be changed to represent one
of your .bmp files. This sample code is not meant to be a working example for your application by any means and is just something for you to look at to get started. It should be expected that you will know how to work with files in a binary format and how to manipulate the data types used inside of your specific database.

Jason F.
Applications Engineer
National Instruments
www.ni.com/ask
0 Kudos
Message 2 of 2
(3,212 Views)