CSLUG - Central South LabVIEW User Group (UK)

cancel
Showing results for 
Search instead for 
Did you mean: 

Connection to MySQL Database

Hi all,

Can anyone here help with an error when connecting to an Oracle SQL database?

I`m using the Database Connectivity Toolkit in LV2014 and have created a UDL to connect the databse. The UDL connects and tests just fine but I get the error message below when I try to connect and list tables.

Error Code -2147467259

NI_Database_API.lvlib:DB Tools Open Connec (String).vi->NI_Database_API.lvlib:DB Tools Open Connec (Path).vi<ERR>ADO Error: 0x80004005

Exception occured in Microsoft OLE DB Provider for ODBC Drivers: [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application in NI_Database_API.lvlib:DB Tools Open Connec (String).vi->NI_Database_API.lvlib:DB Tools Open Connec (Path).vi

Does that ring any bells for anyone ?

Thanks in advance,

Nick H

0 Kudos
Message 1 of 23
(12,700 Views)

Is it a 32 bit 64 bit issue?

32 bit LabVIEW won't play nice with a 64 bit database.

Steve


Opportunity to learn from experienced developers / entrepeneurs (Fab,Joerg and Brian amongst them):
DSH Pragmatic Software Development Workshop


Random Ramblings Index
My Profile

Message 2 of 23
(8,428 Views)

Thats a good point, I`m on 32bit Labview and 64bit Windows but i`m not sure what the server IT is using has .

Thank you , i`ll look into it .

0 Kudos
Message 3 of 23
(8,428 Views)

The other complication is the odbc admin will be 64 bit, try using this.

WOWodbc.png

Steve


Opportunity to learn from experienced developers / entrepeneurs (Fab,Joerg and Brian amongst them):
DSH Pragmatic Software Development Workshop


Random Ramblings Index
My Profile

Message 4 of 23
(8,428 Views)

Hi Nick,

Not sure you need to worry about whether the server is running 64 or 32 bit but you just need to make sure that the drivers you have installed locally are 32 bit. Using the last window Steve posted will show you the 32 bit drivers installed.

James

James Mc
========
CLA and cRIO Fanatic
My writings on LabVIEW Development are at devs.wiresmithtech.com
Message 5 of 23
(8,428 Views)

Thank you Steve and James, I`m looking into that as we speak.

Out of curiosity which method for connection would you both prefer, using the NI DB Tools or through a .NET connection and MySQL connectors ?

0 Kudos
Message 6 of 23
(8,428 Views)

Is it MySQL or Oracle Nick?

If it's MySQL I use a modified TCP connection tool kit that chats to the server through port 3306 (I think)

I only use the database connectivity stuff if I really have to. So if I'm using ODBC I will use the very old LabSQL toolkit (It's quicker, easier, licence free)

I object to my customers paying extra for something that should be part of the language by default.

I can email you the libraries if you need them.

Steve


Opportunity to learn from experienced developers / entrepeneurs (Fab,Joerg and Brian amongst them):
DSH Pragmatic Software Development Workshop


Random Ramblings Index
My Profile

0 Kudos
Message 7 of 23
(8,428 Views)

Hi Steve,

Well I didnt personnally setup the DB but IT have informed me that its a MySQL DB so I was wrong to say Oracle ... sorry !

I like the idea of using TCP to connect with LabSQL, if you could email over the libraries that would be great, thank you !

I`ll send you a message with my email.

Cheers,

Nick

0 Kudos
Message 8 of 23
(8,428 Views)

Finally got it all up and running , now just to have a fight with SQL 😉

It was all down to the 64 bit / 32 bit ODBC admin.

Thank you both for your help !

Nick

0 Kudos
Message 9 of 23
(8,428 Views)

I can do a demo on SQL creation using Navicat and MySQL if you're interested, I find it makes SQL really simple.

If you cannot wait until our next meeting I can pop up a video.

It's a paid program (about £80) but really saves me time.

Steve


Opportunity to learn from experienced developers / entrepeneurs (Fab,Joerg and Brian amongst them):
DSH Pragmatic Software Development Workshop


Random Ramblings Index
My Profile

0 Kudos
Message 10 of 23
(8,428 Views)