Mysql Odbc Ansi Driver 32 Bit

0 views
Skip to first unread message

Oday Forster

unread,
Aug 4, 2024, 6:37:32 PM8/4/24
to ualesertrop
FirstlyI should say that I don't use MySQL but I do know about ODBC Drivers. In ODBC there are different APIs for unicode and ansi. The ansi APIs end in A and the unicode APIs end in W (e.g., SQLPrepareA and SQLPrepareW). The ansi APIs accept bytes/octets for character strings and hence can only handle chrs 0-255. The unicode APIs accept SQLWCHARs which are 2 byte UCS-2 encoded unicode codepoints (newer MS SQL Server versions can handle UTF16 encoded strings) and so can handle approximately the first 65000 codepoints in unicode.

If you store unicode data in MySQL it will be UTF-8 encoded and transferred over your network as UTF-8. At the client end the ODBC driver will have to convert the UTF-8 encoded data into UCS-2 as this is what ODBC needs. Obviously the reverse applies.


If you write an ANSI ODBC application (that is one which uses the ansi ODBC apis) with a unicode ODBC driver then the ODBC Driver manager will have to convert the UCS-2 the driver returns to 8 bit (lossy) and convert the 8 bit data you pass to the driver to UCS-2. So don't do that.


As you may know Ansi and unicode are applied to the data character type.You can choose one or the other, it is not a question of processorHere is the difference between them:- Unicode allow you to have all the characters properties enabled but reducing raw speed treatment- Ansi, the opposite, less character type but raw speed treatement will speed up


When I look at the ODBC Data Source Administrator on my desktop (where the query fails), the drivers tab shows 2 MySQL drivers: MySQL ODBC 5.3 ANSI Driver and MySQL ODBC 5.3 Unicode Driver. I tried uninstalling the MySQL drivers and installing the latest MySQL drivers with the same error.


Sounds like a bug in Toad Data Point. We bundle our own mySQL drivers, so the error you are getting should not be a problem. What version are you using? Can you download the latest Toad Data Point, which is 4.1?


Yes, I am attempting to run the query in TDP. Yes, windows is a 64 bit version. I did uninstall the MySQL ODBC drivers, and installed the 64 bit MySQL ODBC drivers. The download file is entitled: mysql-connector-odbc-5.3.7-winx64. Do you think I need to reinstall using a different file?


I am presently working on a MySQL database. Trying to connect remotely to the server from my client computer using LabVIEW 18. I have tried many configurations along the way, however my UDL won't connect itself to the MySQL server and it's subsequent databases. I have made sure to install or update anything that may cause an architecture mismatch(ODBC drivers, Visual Studio, etc.), which I had hoped would be the answer, but woefully it is not. Any help to get this moving in an appropriate direction would be greatly appreciated.


Go to Settings -> ODBC (64-bit) on the client computer and add a System DSN reference. You can specify all the details of the connection and even test it. Save this to dsn file and refer to it n LabVIEW.


I have done this exact thing previously but as RolfK suggested being aware of the variance between 32 and 64 bit odbc sources. I followed your instructions to the letter except using the 32 bit odbc, because I am running 32 bit LV as well as 32 bit Data Connectivity Toolkit. I was able to create the system DSN with a successful connection, although I had to create a new user name on my server side, because for whatever reason the access was denied to my previous login, even though all the same permissions are granted. Still however, the issues persist. When creating the UDL to put into the path for the data connect open in my VI. I select my newly created system DSN from the data source list, enter my credentials and receive the error.... "Test Connection failed because of an error in initializing provider. Catastrophic failure"


MySQL is now maintained (owned?) by Oracle, and Microsoft never supported MySQL and now will even less likely. Rather the hell is freezing over first. In the past I always simply setup a connection in the ODBC Admin (right bitness) and then collected the settings from the registry entry and directly passed a connection string with those settings to the ODBC interface. I'm using my own ODBC driver usually, but that should also just work for the Database Toolkit.


It appeared the most logical provider to select on the data link properties as my data source is an ODBC and ALL of the options available on my provider list are Microsoft....Is there a way to create a new provider? Or some other option for me to choose? Am I just missing something(completely possible, haha)?


I am already using the MySQL ODBC Driver 5.1 and use it to create my System DSN with a successful connection during data source creation. It is in the process of creating the UDL that I get the error messages and cannot connect.


If you need other options to configure your server connection, try them out in ODBC Admin and store them to a DSN. Then check in the registry under "Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\ODBC\ODBC.INI\" what settings are all there and add them to the above string.


If you have a configured DSN Name you can also just pass that name to the DB Tools Open Connec (String).vi but if you work with a fixed driver and database setup I usually prefer to hardcode those settings in the LabVIEW code and avoid having people to edit ODBC DSN entries.


AFAIK, Everything you can configure in ODBC can be specified in the connection string. At least a proper connection string can connect to SQLServer, Access or Excel just fine without ODBC. I don't know about MySQL, it might depend on the library you're using.


When I linked to my exported MySQL table using MS Access as the front end and connect using MySQL ODBC 8.0 ANSI Driver (32 bit) I found problems with the time format. Using Access tables my date format would look like 5/25/11 9:10:09 AM but the same record in the linked SQL table looks like '2011-05-25 09:10:09'. When trying to add a record that has time on it I get an error message. The Message box from Access says "ODBC call failed [MySQL][ODBC 8.0(a) driver][mysqld-8.0.28]Date overflow (#0). Similarly, when I try to delete a record I get the same error message. I can't put the time into the Access field in the same format as the SQL field as that creates an error. So it seems that the Access format has to be the same as the host computer format. Let me know if you have any suggestions how I can make this work.


Based on my (ancient) MS Access experience, you might need to attach some VBA code to your form inputs, instead of binding them directly to the data source/table columns, to convert or otherwise reformat the date & time entered in the form. You would, in essence, construct an INSERT or UPDATE statement as a string and then execute that statement to pass to the MySQL instance. Or, if the INSERT/UPDATE can be encapsulated in a MySQL stored procedure, you would construct the procedure call as a string and pass the parameters to it. I haven't done this in MySQL but have done it a lot with SQL Server linked tables and stored procedures behind MS Access forms.


I can't understand why you'd get that error message when trying to delete a row. It makes me think there's some issue in the ODBC driver, or in the way MS Access is binding to the data source. If you have a way to profile or trace the statements being sent from Access to MySQL, that might illuminate where the error lies.


Thanks for the info. I have 50,000 lines of code in my current Access database so I would prefer not to move to a different platform but worth looking into. I agree, not sure of ODBC 5.o will work either. Probably will try just to see what will happen but don't really like to rely on older software due to bugs and security concerns.


The Wiki page SWI-Prolog connecting to PostgreSQL via ODBC might be of help. While it is not specific to your setup it does take smaller steps in verifying things along the way. Also it uses /etc/odbc.ini as opposed to .odbc.ini.


Who knows? It has been suggested here before: first try using the commandline tools that come with the ODBC implementation. Also note that the SWI-Prolog ODBC driver can be compiled against iODBC and UnixODBC. The pre-build binary you can download from SWI-Prolog.org has been compiled against UnixODBC. The commandline tool of UnixODBC is isql as mentioned here before. iusql is its Unicode cousin. These tools have debug options that may hint at what is wrong.


Throwing the error message into Google Translate, I get "driver summary odbc data source not found and driver name not specific".

Looking at the ODBC engine documentation makes me think something is incorrect in your COMPLETE connection options.






Has this worked in the past?

Has anything changed?

You could try submitting the libname statement without the user, pwd, database and server parameters, you should then get a dialog box requesting the parameters, maybe that would give you a more detailed error or a clue.






To be a little more specific the required ODBC driver needs to be installed on the remote SAS application server and this server must also be able to communicate with the database server being connected to. If this is a database running on a PC then this could be tricky.


Exception from HRESULT: 0xC0014020

Error at DFT - Insert into MySQL [ODBC Destination [476]]: SQLSTATE: 42S22, Message: [MySQL][ODBC 8.0(a) Driver][mysqld-5.7.38-0ubuntu0.16.04.1+esm1]Unknown column 'Syn?e' in 'field list';


I don't have a column named 'Syn?e' in the table. I've found some articles saying that triggers may cause this issue but I don't have any triggers on the table. I've dropped and created the table fresh and still get this error. I can't find any other information regarding this error :(.


Thank you very much indeed @Hamici Mohamed - I had spent a couple of hours with various configurations failing. Initially I tried the ADO.NET it failed, then tried the ODBC failed until I came up to your solution.

3a8082e126
Reply all
Reply to author
Forward
0 new messages