MySQL ODBC is a 32 bit ODBC (2.50) level 0 driver for Windows95 and NT. We hope somebody will port it to Windows 3.x.
We have only tested ODBC with Admndemo, some C programs, Msquery and Excel.
To give some light about any problem we would like to have the log file from the ODBC manager (the log you get when requesting logs from ODBCADMIN) and a MYODBC log.
To get a MYODBC log, please put this MYSQL_DEBUG=d:t:O,filename
in your `AUTOEXEC.BAT' and restart.
The log will be written to file `filename'.
Most programs should work with MyODBC, but these we tested ourselves or got a confirmation from some user that is works:
SELECT concat(sunrise_time), concat(sunset_time) FROM sunrise_sunset;Values returned in this format (string) should be correctly recognised by Excel97 as time values. What
concat()
does in this case is that it fools ODBC to think
the column is of 'string type'. Without the 'concat()' ODBC knows the
column is of time type. Excel does not understand that.
Note that this is a bug in Excel because it automaticly converts a
string to a time. This would be great if the source was a text file, but
this is plain stupid when the source is a ODBC connection which reports
exact types for each column.
There are three possibilities for specifying the server name on Windows95:
ip hostname
For example:
194.216.84.21 my
Example of how to fill in the 'ODBC setup'.
Data Source Name: test Description: This is my test database Server: 194.216.84.21 User: monty Password: my Port:
These are default values to be given when prompting for a Driver connect. You don't have to give 'server', 'user' or 'password' in this screen. If port is not given the default port (3306) is used.
When connecting to an ODBC source you have the option to change the server, user, password and port.
A common problem is how to get the value of an automatically-generated id
from an INSERT
. With ODBC you can do something like this:
INSERT INTO foo (auto,text) VALUES(NULL,'text') select LAST_INSERT_ID()
or if you are just going to insert in into another table:
INSERT INTO foo (auto,text) VALUES(NULL,'text') INSERT INTO foo2 (id,text) VALUES(LAST_INSERT_ID(),'text')
Go to the first, previous, next, last section, table of contents.