LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Connecting to a Microsoft (MS) Access Database in LabWindows

I am trying to connect to an MS Access Database through labwindows (7.0).  However, on the dbconnect() call, I am getting a return error: -99: Database DLL could not be loaded.  What does this mean?  How can I fix it?  I have installed MS office 97 with access, labwindows 7.0 and the sql toolkit 2.0.6
 
Thanks
0 Kudos
Message 1 of 14
(6,727 Views)
If it helps, I'm using windows 98, and this is code that was written several years ago on lab windows v4.0.1 on windows 95.  It worked then, and I'm trying to get it to run again on our new systems. 
0 Kudos
Message 2 of 14
(6,701 Views)

What is your connection string in the dbconnect function ?

JP

0 Kudos
Message 3 of 14
(6,691 Views)

Fmt (sqlString,"DSN=%s;UID=%s;PWD=%s",dbName,dbUser,dbPassword)

dbHandle = DBConnect (sqlString);

 

The above variables (dbName, dbUser, dbPassword), are all passed in as parameters to the method.  I tried printing them out to screen and they were correct. (prod_db, myuser, mypass)

0 Kudos
Message 4 of 14
(6,686 Views)
of course you create the DSN under windows odbc data source ?
0 Kudos
Message 5 of 14
(6,682 Views)

yes. 

went to control panel >> ODBC data sources >> system dsn tab

added microsoft access driver (*.mdb) with datasource name = prod_db

selected the database & under system database selected the workgroup.

0 Kudos
Message 6 of 14
(6,679 Views)
compiling a debug version of the app, I was able to see a little more of the error:
 
"library function error (return value ==-99
[0xffffff9d]
Database DLL could not be loaded"
 
Google only came up with one non-informative result on the NI forums for "database dll could not be loaded"
However, searching for odbc error code 99, I found that -99 might be a priviledge violation? 
 
I don't know what this would mean, because I log into the database with the same user & pass the program uses.  I assume I am either looking at the wrong error code list, or there is another explaination?
 
Thanks
0 Kudos
Message 7 of 14
(6,677 Views)
Reading another post, I realized I should have looked at the header file first (cvi_db.h).  This told me that -95 (the error from the cvi library) is DB_DLL_NOT_LOADED.  This didn't really help me.  I have a feeling that my problem is that I'm trying to use code made on windows 95 in lab windows 4.0.1 now on a windows 98 system (soon xp) with labwindows 7.0.
 
Has anyone else had to convert their database code from 4.0 to 7.0?  Any guidance here?
0 Kudos
Message 8 of 14
(6,663 Views)
Hello,

Can you try running the shipping examples that come with the SQL toolkit and see if you get the same error? The examples are located at C:\Program Files\National Instruments\CVI70\sql20\samples and the good ones to try would be simple\Connect.cws, simple\Readtab.cws, apps\Browser2.cws, etc.

Also, you have mentional that you use SQL toolkit v2.0.6 with CVI 7.0 on Win 98, but which version of the toolkit was your old application developed with (on CVI 4.0.1, Win 95)?

Thanks and good luck!
Shakhina P.
Applications Engineer
National Instruments
Message 9 of 14
(6,634 Views)
Yes, that sample worked (simple/connect).  I even changed the dsn to my database and added the uid & pwd.  It still connected ok. 
 
To answer your other question, I believe this was developed originally in win95 cvi 4.0.1.  Looking at a couple comments, it's possible part was done on win 3.1.
0 Kudos
Message 10 of 14
(6,618 Views)