03-06-2016 06:25 AM - edited 03-06-2016 06:28 AM
Hello,
I have one SQLite3 data base file. I got to read with labivew. I installed the OBDC driver from http://www.ch-werner.de/sqliteodbc/.
I created the DSN. I would like to read diferent files .db with their paths.
If I use directly the DSN 'temperatura' is works fine, but it always read from the path i put in configuration of DSN - Database Name. Check the attached file.
I wold like to have one path controller to read any file, but the connection string always read from the same file. In http://www.connectionstrings.com/sqlite3-odbc-driver/ show it:
DRIVER=SQLite3 ODBC Driver;Database=c:\mydb.db;LongNames=0;Timeout=1000;NoTXN=0;
SyncPragma=NORMAL;StepAPI=0;
But it doesnt work. it didnt find the provider.
I found in internet this:
Provider=MSDASQL.1;Initial Catalog=C:\test.db;Persist Security Info=False;DSN=temperatura
IT works but always read from the file fixed in DSN temperatura configurated in OBDC administration
In initial catalog i put another file and read the same that is on temperatura DSN.
Any way i can use correct connection array to read from diferent file?.
Regards
Solved! Go to Solution.
03-07-2016 03:24 AM - edited 03-07-2016 03:25 AM
I do not know SQLite connection strings. But this is my "PostgreSQL Unicode" ODBC driver connection string.
Provider=MSDASQL.1;Extended Properties="DRIVER={PostgreSQL Unicode};SERVER=AXXE03vm;UID=username;PWD=password;READONLY=0;DATABASE=logistics"
The string "PostgreSQL Unicode" is the name as it is found in "Control panel" - > "ODBC Data Source Administrator".
(LabVIEW 2012.)
Regards
03-07-2016 03:39 AM
The documentation for the SQLite library seems to suggest that you only need to use this as your connection string:
Driver=SQLite3 ODBC Driver;Database=full-path-to-db;
What version of LabVIEW are you using and what bitness (32/64)? There are two versions of the ODBC Connection manager - one for 64-bit ODBC drivers, and one for 32-bit ODBC drivers - they are treated separately by the OS.
I've never used that library - but there is an alternative which I've used and it works pretty well: http://sine.ni.com/nips/cds/view/p/lang/en/nid/212894
03-07-2016 03:57 AM - edited 03-07-2016 03:59 AM
Ok, now it works.
I used:
DRIVER=SQLite3 ODBC Driver;Database=full path db;LongNames=0;Timeout=1000;NoTXN=0;
SyncPragma=NORMAL;StepAPI=0;
I am using LV 32bits in w7 64bits i installed both 64 and 32bits drivers like the website showed.
I dont know why now works. I delete the path on OBDC and dont put any reference to temperatura (previous data source DB).
Thanks guys!.
Regards.
03-07-2016 05:21 AM
I thought "Provider=MSDASQL.1;Extended Properties=" was needed, but i now see that my post was just noise.
Anyway, i learnt something and simplified my own connection string to DRIVER=PostgreSQL Unicode;SERVER=AXXE03vm;UID=username;PWD=password;READONLY=0;DATABASE=test_logistics.
08-25-2017 03:05 AM - edited 08-25-2017 03:08 AM
Thank you for sharing,
I'm adding here an important note for those who like me are used to put the Quotes "" around every path in Windows, DON'T DO IT here for the 'Database=full path db' it will throw the ERRROR: Exception occured in Microsoft OLE DB Provider for ODBC Drivers: connect failed in name.vi