LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SQLite3 connection string?

Solved!
Go to solution

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

Download All
0 Kudos
Message 1 of 6
(9,301 Views)

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

0 Kudos
Message 2 of 6
(9,234 Views)
Solution
Accepted by topic author Fonsi

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


LabVIEW Champion, CLA, CLED, CTD
(blog)
Message 3 of 6
(9,223 Views)

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.

 

0 Kudos
Message 4 of 6
(9,209 Views)

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.

 

 

 

0 Kudos
Message 5 of 6
(9,197 Views)

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

0 Kudos
Message 6 of 6
(8,100 Views)