LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

access database connectivity

Solved!
Go to solution

I am trying to connect to an access database (office 365).  I downloaded the SQL toolkit (trial version) and would like to connect to a simple database I created on my local C drive.  I am having trouble with the connection string.  The examples in CVI are very poor and only connect to the sample cvi database.  the example that does connect to the microsoft access database crashes.  any suggestions?

0 Kudos
Message 1 of 18
(5,654 Views)

Connecting to a database using the SQL toolkit is easy if you can provide a DSN for it.

Consider that the SQL toolkit is a 32-bit tool: you can only use it while creating 32-bit executable even in 64-bit environment. Nevertheless, in such a case you must create the DSN using the 32-bit version of the ODBC administrator, which you can find in C:\Windows\SysWOW64\odbcad32.exe (note that even the 64-bit program is called odbcad32! Smiley Surprised )

Once created the appropriate DSN that points to your database (let's call it "MyDSN" for clarity), you should be able to connect to it by using  dbH = DBConnect ("DSN=MyDSN");



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 18
(5,641 Views)

I think a created the dsn correctly.  when I try to connect it returns a -10.

0 Kudos
Message 3 of 18
(5,632 Views)

Error -10 is a system error raised from the OS: try calling DBNativeError and see if some error code is returned.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 18
(5,623 Views)

error code 0x800004005 when I try to connect to my db

error code 0x80040E4E when trying to connect to the default microsoft database in CVI sql example browser2

 

0 Kudos
Message 5 of 18
(5,601 Views)

Have you read this document?



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 6 of 18
(5,588 Views)

I read the document.  I tried adding a new connection.  it shows up in the browser2 window.  when I select it it still gives me the -10 error message.  Is there a different way to make a connection to a database?  I have a simple table with 5 entries I would like to use to store and retrieve data from multiple pc's.

0 Kudos
Message 7 of 18
(5,577 Views)

I have no problems in connecting to a MS Access database provided that:

 

  • The DSN is configured in the 32-bit version of the ODBC administrator
  • The DSN correctly points to a file

Is your file on the local machine or on a network shared resource?



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 8 of 18
(5,573 Views)

I found an issue with my a corrupted driver in my administrator tools.  I deleted it and recreated it.  Still no luck.  My databse is on my local machine.  I am using windows 7 and configured for 32 bit ODBC. 

0 Kudos
Message 9 of 18
(5,553 Views)

I deleted everything and restarted my pc.  I followed the procedures again and it is now working.  Thanks for you help!  Kudos!!!!

0 Kudos
Message 10 of 18
(5,537 Views)