LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Create ODBC Database DSN Dynamically

Robert,
Add this statement to the code and see if it works, this contains the location.  Obviously MyDir and MyDatabase.mdb should fit to your parameters.

RegWriteString (REGKEY_HKLM,

 DatabaseKey,

 "DBQ", //The Location,

"C:\\MyDir\\MyDatabase.mdb"); //location of the database on the machine

-Dave

0 Kudos
Message 11 of 13
(1,759 Views)

Thanks,

I would try it tomorrow to see how it works.

Robert

 

0 Kudos
Message 12 of 13
(1,752 Views)

For me, the easiest has been to create a myconnection.dsn file using the ODBC administrator control panel.

Then, in your executable distribution, include the myconnection.dsn file, and stick it in C:\Program Files\Common Files\ODBC\Data Sources

Then, you can use the following connect string : "filedsn= myconnection.dsn;UID=userid;PWD=password", and it works like a charm, both in LabVIEW and LabWIndows

in addition, because the DSN is in a standard location, other application, such as Excel can use it just as easy.

 

0 Kudos
Message 13 of 13
(1,491 Views)