02-05-2015 03:52 AM
Hi all,
i'm trying to gain access to a database created by Access 2013 from Labview 2014. Since we dont want to buy the NI toolkit i thought to use the old LabSQL library. Has anyone tried to do the same thing or give me some hints about it?
Actually i have tryed to run the example shipped with LabSQL but i received an error:
Exception occured in Microsoft OLE DB Provider for ODBC Drivers: [Microsoft][Driver Manager ODBC] Nome origine dati non trovato e driver predefinito non specificato. in ADO Connection Open.vi->Example - Fetch a Table.vi
Reading the README file of the LabSQL i found this:
2. As with any database application on Windows, you'll need to create a DSN (Data Source Name) in the ODBC control panel. This DSN is used in your LabVIEW application to connect to the appropriate database. If you want to set up the example database, do the following:
a.Go to your Windows Control Panels, and open "ODBC Data Sources"
b.Click on the "System DSN" tab
c.Click on the "Add..." button.
d. From the list of drivers, choose "Microsoft Access Driver"
e.At the dialog box, type in "myDB" for the Data Source Name. Then click on "Select..." button, and find the file "Sample Database.mdb" included with the LabSQL examples. Leave everything else as it is, and hit OK.
f. Close the ODBC control panel
g. Test the connection by running one of the examples provided.
My problem is that i can't find the driver named "Microsoft Access Driver" so i can't continue through the points of the instructions. I only found "SQL Server" and "SQL Server Native Client 11.0" but if i select one of this the dialog box that appear later is different from the one described in the README instructions...
02-05-2015 10:35 PM - edited 02-05-2015 10:37 PM
You can certainly access the database without the toolkit. There are drivers that I posted on the forum and I have a small complete application on my blog -- you can even download the code from my SVN repository.
In terms of you specific problem, you don't need a DSN. What you need is something called a "connection string". Also, don't waste your time with ODBC. The built-in ADO drivers are easier to use. Again, check my posts for details -- I did a 3-part series on database connectivity.
Mike...
02-06-2015 02:15 AM
Hi mike, thank you for answering.
My problem is that i cannot find a connection string that giving me no error. I try to use the connection string listed in the site you suggest but sill my problem remain. I have a windows 7 based pc with microsoft access 2013 installed it is possible that i haven't installed some thing. For example i can't find the "Msjet40.dll" on my system32 directory.
02-06-2015 04:57 AM
02-06-2015 07:01 AM
Mike, thank you for your time. I finally found the problem. It seems there is a bug in Windows 7 64 bit. I had to change the path of the "ODBC Data Sources" from "%windir%\system32\odbcad32.exe" to "C:\Windows\SysWOW64\odbcad32.exe". Opening this second .exe (that i presume is the 64 bit version) allowed me to find the "Microsoft Access Driver" and now all is working fine.