From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
08-26-2014 01:06 PM - edited 08-26-2014 01:08 PM
I am using the database connectivity tool kit to access a mysql database. The problem we've been having is the very first time a query is run after a period of inactivity it is extremely slow to respond (several minutes). After that the same query and other queries of the same database/table are fast 3-4 seconds.
We've been using the ODBC 5.1 driver but i wanted to switch to OLE DB to see if that would fix the problem. But I havent been able to get it to connect at all. I've searched the https://www.connectionstrings.com/ site and came up with the following:
Provider=sqloledb;Data Source=IPaddress, 3306;Initial Catalog=catname;
User Id=user;Password=bla;
but i get the error
Possible reason(s):
ADO Error: 0x80004005
Exception occured in Microsoft OLE DB Provider for SQL Server: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. in NI_Database_API.lvlib:DB Tools Open Connec (String).vi->db query test.vi
Looking in data sources it says SQL server version 6.01.7601.17514
Seems like an old version...maybe the connection string format is different but i havent been able to find it...
Anyone know the correct connection string and/or another possible cause of the delay in returning query results?? Thank you.
08-26-2014 01:12 PM
Are you talking to mySQL or SQL Server -- that two different products. There are OLE DB drivers for mySQL but you aren't refering to them in the connect string.
Mike...
08-26-2014 01:22 PM
Thanks Mike, I think it's mysql. The original connection string was Driver=[mysql odbc 5.1 Driver} . I installed the mysql driver you linked to and tried
Provider=MySQLProv;Data Source=mydb;User Id=myUsername;Password=myPassword;
but i get
NI_Database_API.lvlib:DB Tools Open Connec (String).vi->db query test.vi<ERR>ADO Error: 0x80004005
Exception occured in Provider: Unspecified error in NI_Database_API.lvlib:DB Tools Open Connec (String).vi->db query test.vi
08-26-2014 01:30 PM
is http://cherrycitysoftware.com/ccs/Download/Download.aspx equivalent to the my ole db you linked?
08-26-2014 02:11 PM
http://www.connectionstrings.com/mysql/ very helpful
08-26-2014 02:34 PM
08-26-2014 03:13 PM
You can do the following:
Create a text document on your desktop and rename it to something like connection.udl
Double click the file
Configure the settings and test the connection
Open up the UDL file in a text editor and it will contain the connection string.