LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

SQL Toolkit Support for the MySQL Database Server.

I would like to use the MyODBC Driver v3.51 to access a MySQL Database Server using the DBBind... function set.

(1) Is this supported by the SQL Toolkit?

(2) What are the optimal or required settings for the MyODBC Driver when using it with the SQL Toolkit?

(3) MySQL also ships with a .lib and .h file for using direct calls from C/C++ to the server w/o ODBC. I was unable to compile my program in LabWindows when including the library and header files. I have successfully used these libraries in MS Visual C++ and GNU C to connect to the MySQL server.

Could this be a compatibility problem with MySQL and LabWindows? Is there a special method I have to use when compiling/linking?

Thanks!

-Roy
0 Kudos
Message 1 of 5
(4,831 Views)
1,2) I was able to connect to a MySQL Database using your same version of the MyODBC Driver and the SQL Toolkit in LabWindows. After I setup a System DSN for the database, connecting to the database went smoothly. I assume the DBBind... functions should work without any additional setup.

3) It looks to me like the C API for MySQL was designed specifically for a UNIX system, or Visual C++. It appears that several Windows libraries and headers would need to be included in the project in order to get the API to work with LabWindows. I bet that these libraries could be made to work with LabWindows, but it might involve some changes to the MySQL header files.

Good Luck!
0 Kudos
Message 2 of 5
(4,831 Views)
Thanks logman, since posting my question I have got some more detail as to exactly what my problem is with the MyODBC driver.

When querying the MySQL DB with DBFetchRandom(lastRecord) -lastRecord being the last record in the MySQL DB- I get a general protection fault 017f:04a6b054.

I was able to get around this problem by changing my Select statement to sort so that the last record is listed first. I then used DBFetchNext() to get the last record written with no problem.

Something else I am noticing is that the time to complete a query to MySQL is increasing as a function of elapsed time. (memory leak maybe) I'm looking over all my code to verify I'm not the source of my troubles.

Thanks, any further comments or info would be apprecia
ted, especially relating to the General Protection Fault with DBFetchRandom. I am using DBAllowFetchAnyDirection() btw.

-Roy
0 Kudos
Message 3 of 5
(4,831 Views)
You may want to look at :
http://perso.wanadoo.fr/philippe.baucour/pratiquer/mysql/mysql.html
A step by step procdure explains how to use the lib (you need to slighttly
modify the header file) and ovoid the ODBC driver.

--
Philippe
Feel free to visit : http://perso.wanadoo.fr/philippe.baucour



"rjohnson@sparton.com" a écrit dans le message de news:
506500000008000000C77D0000-1042324653000@exchange.ni.com...
> I would like to use the MyODBC Driver v3.51 to access a MySQL Database
> Server using the DBBind... function set.
>
> (1) Is this supported by the SQL Toolkit?
>
> (2) What are the optimal or required settings for the MyODBC Driver
> when using it with the SQL Toolkit?
>
> (3) MySQL also ships with a .lib and .h file for using direct calls
> fr
om C/C++ to the server w/o ODBC. I was unable to compile my program
> in LabWindows when including the library and header files. I have
> successfully used these libraries in MS Visual C++ and GNU C to
> connect to the MySQL server.
>
> Could this be a compatibility problem with MySQL and LabWindows? Is
> there a special method I have to use when compiling/linking?
>
> Thanks!
>
> -Roy
Message 4 of 5
(4,831 Views)
Excellent!!! This worked just as promised. I had to use Google to translate the page from French to English but the instructions were very clear and correct. Thanks!!!

-Roy
0 Kudos
Message 5 of 5
(4,831 Views)