MyODBC
所属分类:MySQL数据库
开发工具:C/C++
文件大小:206KB
下载次数:111
上传日期:2006-03-07 12:03:20
上 传 者:
nikky
说明: MySQL的ODBC接口程序源代码(语言:VC)
(MySQL ODBC interface program source code (language : VC))
文件列表:
MyODBC\dbug\dbug.c (49325, 2002-03-25)
MyODBC\dbug\dbug.dsp (2863, 2002-03-25)
MyODBC\dbug\dbug.dsw (533, 2002-03-25)
MyODBC\dbug\dbug.h (2332, 1997-02-12)
MyODBC\dbug\dbug_ana.c (19666, 1998-04-24)
MyODBC\dbug\example1.c (175, 1997-02-08)
MyODBC\dbug\example2.c (261, 1997-02-08)
MyODBC\dbug\example3.c (227, 1997-02-08)
MyODBC\dbug\factoria.c (358, 1997-02-08)
MyODBC\dbug\main.c (745, 1998-04-24)
MyODBC\dbug\sanity.c (277, 1998-04-24)
MyODBC\dbug (0, 2002-03-25)
MyODBC\include\dbug.h (2331, 1998-04-24)
MyODBC\include\global.h (2311, 2002-03-25)
MyODBC\include\list.h (909, 1997-02-12)
MyODBC\include\mysql.h (6784, 1998-04-24)
MyODBC\include\mysql_com.h (5277, 1998-05-19)
MyODBC\include\mysql_version.h (320, 1998-04-24)
MyODBC\include\mysys_err.h (1045, 1998-04-24)
MyODBC\include\my_alarm.h (1428, 1998-04-24)
MyODBC\include\my_dir.h (2556, 1998-04-24)
MyODBC\include\my_pthread.h (8032, 1998-04-15)
MyODBC\include\my_sys.h (18799, 1998-04-24)
MyODBC\include\m_ctype.h (4965, 1998-04-24)
MyODBC\include\m_pc.h (6977, 1998-04-24)
MyODBC\include\m_string.h (5554, 1998-04-24)
MyODBC\include\Odbcver.h (0, 1998-05-11)
MyODBC\include\s_msdos.h (7155, 1998-05-11)
MyODBC\include\thr_alarm.h (1331, 1997-11-08)
MyODBC\include (0, 2002-03-25)
MyODBC\lib\errmsg.c (1645, 1997-12-26)
MyODBC\lib\errmsg.h (1018, 1997-12-26)
MyODBC\lib\lib.001 (2798, 1998-05-05)
MyODBC\lib\lib.dsp (2937, 2002-03-25)
MyODBC\lib\lib.mak (6725, 1998-06-24)
MyODBC\lib\libmysql.c (38757, 1998-05-04)
MyODBC\lib\makefile (699, 1996-12-06)
MyODBC\lib\net.c (13390, 1998-02-02)
MyODBC\lib\password.c (4729, 1998-04-25)
MyODBC\lib\version.h (286, 1997-10-28)
... ...
This is the source or binary distribution of ODBC for MySQL.
This software is in public domain. You may use it in any way you like.
There is no WARRANTY of any kind. Use at our own risk..
If you want to ensure the development of this product, you should register
for MySQL support and tell that you are using MyODBC in the comment field!
The libraries dbug, mysys, lib and strings libraries are the same that are
distributed with MySQL. There is only a couple of new include files that
defines the windows environment.
The lib directory contains some files from the mysql/client source directory
with makes the libmysql.
The setup32 binary distribution may be obtained from the file myodbc-xxx.zip
at http://www.tcx.se/
To get all functionality from the ODBC driver you should use it against
MySQL 3.21.17 or above. This driver also works with MySQL 3.20.x
To compile with Microsoft VC++ one will need the ODBC 3.0 package from
Microsoft or VC++ 5.0 professional edition.
This version of MyODBC is made with VC++ 5.0, with a define to force ODBC 2.50
usage, together with the installer from ODBC 2.5.
I will look into the 3.0 ODBC kit when I can get the installer problem solved.
I may be able to fool the setup program by using a 2.5 installer with a
ODBC 3.0 driver, but I have to investigate this at some later time.
In the source distribution the example makefiles and resources are made
with VC++ 5.0.
HOW TO MAKE A PROPER BUG REPORT:
To make a bug report that will be answered quickly do the following:
Put a 4 in the Option argument. This will tell MyODBC to make a trace
file in C:\myodbc.log that contains lot of info with will help us to
debug the problem. One can also set the MYSQL_DEBUG environment variable
to something like 'd:t:O,c::\tmp\mysql.log' to get a log in C:\tmp\mysql.log
A sql.log file, with may be enabled with odbcadmin from the Control Panel,
could also provide some interesting info. If possible try to get a log
from the mysqld server too.
IMPORTANT NOTES:
The Option argument in the connect string is to tell MyODBC that the client
isn't 100% ODBC compliant. Each bit in this flag have a special meaning:
1 The client can't handle that MyODBC returns the real width of a column.
2 The client can't handle that MySQL returns the true value of
affected rows. If this flag is set then MySQL returns 'found rows'
instead. One must have MySQL 3.21.14 or newer to get this to work.
4 Make a debug log in c:\myodbc.log. This is the same as putting
MYSQL_DEBUG=d:t:O,c::\myodbc.log in AUTOEXEC.BAT
8 Don't set any packet limit for results and parameters.
16 Don't prompt for questions even if driver would like to prompt
32 Simulate a ODBC 1.0 driver in some context.
*** Ignore use of database name in 'database.table.column'. One can still
use the alternative syntax 'table@database.column' (In mysql 3.22)
128 Force use of ODBC manager cursors (experimental)
256 Remove use of extended fetch (experimental)
512 Pad CHAR fields to full column length.
If you want to have many options, you should add the above flags!
For example Option 12 (4+8) gives you debugging without package limits!
Possible value for 'Option' for some known clients:
BDE applications: 1 (Some BDE applications require 3)
Visual Objects: 1
Vision 2
Active server pages 2
Access 7.0: 2
Access 2.0: 34 (= 32 +2)
ODBCETE32 + quiktest 513 (512+1)
The default MYODBC.DLL is compiled for debugging. In the distribution there
is also MYODBC2.DLL. This is compiled with full optimization. If you want to
use this one, copy MYODBC2.DLL over the installed MYODBC.DLL. If you have
some problems with the optimized one you should first switch back to the
default one before doing a bug report.
If you have any problems with MyODBC, try first to get the 'admndemo'
program, that is include with the MyODBC distribution, to work!
Some common problems:
- Wrong connection port: The port should be 3333 for MySQL 3.20 and 3306
(default) for MySQL 3.21 or newer.
- Access denied problems. Check the MySQL reference manual for information
about the MySQL privilege system!
Authors:
Main coding: Michael 'Monty' Widenius, TCX Datakonsult AB
Known bugs:
- Access can't use float fields in a table without a timestamp if you are going
to update it. Double on the other hand should work.
- There is a bug in the Microsoft ODBC setup that it can't detect if a OS
is NT or WIN95. Because of this MyODBC is distributed in 2 different
versions, one for WIN95 and one for WIN95.
The only difference is the file odbc.inf, which tells SETUP if it should
install CTL3D95.DL_ or CTL3DNT.DLL as CTL3D32.DLL.
If you have downloaded wrong version of MyODBC simple copy ODBC.95 or ODBC.NT
over ODBC.INF and execute setup again!
- ODBC 2.50 doesn't allow very good usage of bigint (*** bit) numbers; some
applications may have a problem with this.
- TIMESTAMP to TIME conversions doesn't work.
- Binary fields are returned as strings, not as hex strings.
- Some conversion are not according to the ODBC standard, but this shouldn't
affect standard applications.
- Some applications thinks that MyODBC has full cursor support. This is not
true (we are working on this however); If your application need full cursor
support you should tell your application to use the ODBC manager cursor
library.
- ODBC can't support zero dates "0000-00-00". MyODBC automaticly converts
0000-00-00 dates to NULL. Date columns that you want to update and that
can be 0000-00-00 should not be declared as 'NOT NULL'.
- As MyODBC doesn't yet have an own cursor library one can only use MyODBC
with applications that follows the ODBC specification and can work with
ODBC MANAGER cursors. Some programs, notably from Microsoft, doesn't
follow the ODBC specification how to use cursors; They only work with
DRIVER cursors! There may be a change that you can fool the application
to use MANAGER cursors by using the 128 option flag!
There is work in progress in supporting cursors in MyODBC. If you are
interested in helping us with this, mail what you can do to myodbc@tcx.se.
You can also support our work by taking MySQL email support!
- One should have to do more testing with MyODBC and multithreaded applications.
MyODBC is compiled multithreaded but there is still some small problems
when compiling with -DTHREAD.
Changes:
2.50.17
- DATE fields was updated with DATE + TIME (bug from 2.50.16)
- BLOB fields are now returned as LONGVARBINARY instead of LONGVARCHAR.
TEXT fields are still returned as LONGVARCHAR.
(Patch by "Shayne Hughes" )
2.50.16
- Lots of extra parameter checking for safer code with different drivers.
- Format MySQL timestamp columns when converted to ODBC strings.
(YYYYMMDDHHMMSS -> YYYY-MM-DD HH:MM:SS)
- Allow NULL values in auto increment columns (for Delphi 3.0)
- Added option to pad character fields with space to max length (for
quiktest.dll)
- Fixes bind problems from 2.50.15
NOTE: If you have problems with 2.50.16, the most stable version is 2.50.13 !
- SQLExtended_fetch() couldn't always read from overlapping start region
2.50.15
- Fixed a problem with Excel and SQLTables() from 2.50.14.
- Changed SQLBindCol() to allow one to remove old value bindings but keep
length bindings (very seldom used, but required by the ODBC standard)
- Allow one to use SQL_CURSOR_FORWARD and SQL_CURSOR_STATIC. Fixes problem
with ASP.
- Change locale for SQL parameters and bound float/double variables to allow
one to have ',' as decimal point in ones locale!
Fix also locale for all SQL parameters that are inserted as CHAR but
requested as DOUBLE. (To fix money type in Access 97)
- If name is truncated, now return the truncated length instead of the original
length (because of the perl DBI/ODBC driver).
- Allow one to SQLBindCol() before SQLPrepare() because of VB 5.0
(Who came up with this BROKEN standard ?)
2.50.14
- Some small changes to SQLTable() to get some ODBC applications to work.
Now one can request catalog names, schema names and table types from
SQLTable().
- Added support for the new YEAR type in MySQL 3.22.
- Added support to turn of schemas in MySQL 3.22 (In MySQL 3.22 schema =
database)
- Different releases for win95 and NT to avoid installation problems on NT.
- Added option to force use of ODBC manager cursors (See the option flag table)
2.50.13
- Added SQLGetInfo(SQL_OJ_CAPABILITIES).
- Added option flag 32
- Fixed bug with SQLGetInfo(DATABASE_NAME = 16) from MyODBC 2.50.12
2.50.12
- Change 0000-00-00 DATE values to NULL if retrieved as DATE.
- SQLParameter() extended to support all ODBC 2.50 parameter types.
- Using new connect protocol for MyODBC 3.21.26 to make faster connections.
- Don't remove \r\n from SQL statement.
- Added option flag 16
2.50.11
- SQLColumns() didn't return right column lengths().
- SQLColumns() on BLOBS columns now returns max blob length.
- SQLGetInfo() now reports that MySQL supports allmost all DATE functions.
- Fixed problem that some applications (at least PowerBuilder) uses wrong
max column lengths for fixed types to SQLBindCol().
2.50.10
- Added support for SQLNativeSQL.
- SQLGetInfo() didn't report that MyODBC supports SQLGetConnectoption.
- Allow SQLBind() to be called before SQLExecute().
2.50.9
- VB5 does a wrong 'SELGetInfo' request where the save address is 0x. Requests
like these are now silenty ignored.
- SQLDescribParam() implemented by always returning VARCHAR(255). As MySQL
can take strings anywhere this should be a workable solution!
- Changed password to allow 16 characters (was 8).
2.50.8
- More debug information to the MyODBC log.
2.50.7
- Upgraded libmysql.c to allow automatic reconnection in some cases.
- Fixed problems in SQLExtendedFetch() and SQLGetTypeInfo() that crashed
Delphi 3.0
- DATETIME now return timestamp as default value (crashed Access)
- The distribution now contains include files and libraries for use
with C clients. One have to link with all included .lib files
to get a C client.
- Use my_SQLExecute instead of SQLExecute to avoid dynamic link problems
on some Unix systems.
- Extended SQLSetConnectOPtion and SQLGetConnectOptions to handle all
options (some are silently ignored).
- SQLGetStmtOption now handles all ODBC 2.5 options.
2.50.6
- Report the MySQL have LEFT OUTER JOIN and all other functions from
MySQL 3.21.17
2.50.5
- Fixed better logging by changing ASCII 0 to \0 when inserting parameters.
- Optimized 'mysql_list_tables' to not call malloc so many times.
2.50.4
- Added Option bits FLAG_BIG_PACKETS and FLAG_DEBUG
- Fixed bug with longvarbinary parameters with ASCII 0
2.50.3:
- Added Option 2 for Access, see NOTES.
- Fixed bug with date fields and Access.
2.50.2:
- Fixed DATETIME and TIME problems when using SQLBind.
- Fixed that port is saved properly.
- Added options flag for some BDE drivers. Options = 1 tells MyODBC not to
return max_width for columns. This should help Delphi connections.
- Changed SqlColumns(), SqlSpecialColumns() and SqlColAttributes() to return
right transfer size.
- TIMESTAMP now always returns precision 19 (because of BDE).
- Added conversion for the DISPLAY_SIZE for SQLColAttributes
2.50.1:
- The installer got linked with the ODBC 3.0 libraries and didn't work.
Fixed by relinking with ODBC 2.50.
2.50.0:
- MyODBC has now tags for ODBC 3.0, but because ODBC 3.0 hasn't a ODBC
installer, MyODBC is still 2.5 based).
- This version works with MySQL 3.20 and MySQL 3.21 servers.
- Updated SQLGetInfo to report all new MySQL functions.
- Added database name to the driver setup.
- Timestamp(12), timestamp(8) and timestamp(6) should now work.
- Added column number check to SQLColAttributes and SQLDescribeCol.
- Added support of SQLExtendedfetch and SQLSetScrollOptions and SQLSetPos.
- Added pre-evaluation of query in SQLDescribeCol, SQLNumResultCols and
SQLColAttributes.
- SQLGetDATA now correctly allows one to retrieve a BLOB in parts with many
calls.
- SQLTables now returns a empty set instead of an error when doing a request
for only VIEWS.
- Fixed lots of bugs in Microsoft example application admndemo.
Hope the ODBC driver manager (also by Microsoft) is not this buggy!!!!!
- Extended SQLSetStmtOption() to handle SQL_ROWSET_SIZE.
1.0.19
- Fixed bug in SQLColAttributes. This bug at least affected Access97 to
return to short fields.
- Extended host name to 60 characters and user name to 16.
1.0.18
- Added missing SQLGetInfo(SQL_TXN_ISOLATION_OPTION) option.
- SQLTables() now search after table qualifier TABLE instead of 'TABLE'
- Changed max client package to 512K
1.0.17
- Added new ODBC 2.5 columns to results of SQlSpecialColumns, SQLPrimaryKeys
and SQLForeignKeys.
- Removed convert of password to lower case in login dialog.
- Added new column definitions from Wim Bonis and Giovanni Maruzzelli.
1.0.16
- Fixed SQLSpecialColumns (line was missing from 1.0.14)
- Removed precision and scale from double and float to get Access to work
better.
1.0.15
- Added patches by Giovanni Maruzzelli and Wim Bonis to fix TIMESTAMP, DATE,
TIME and DATETIME fields.
- SqlSpecialColumns now uses TIMESTAMP as ROWID.
1.0.14
- SQLPutInfo tried to use the memory pointer passed. Now it always makes a copy.
- Added support for the new MySQL DATE and TIME types.
- Blob's with ASCII 0 can now be read.
- Updated libraries from MySQL 3.20.13.
1.0.13
- Password is now longer regarded 'required' in the loggin screen.
- If port is 0 or not given then myodbc defaults to the default port (3333).
- Fixed that '?' is not regarded a parameter in strings.
1.0.12
- Added keywords KEYS, RLIKE to SQLGetInfo.
- Fixed some wrong definitions with TINYBLOB.
- Removed old memory allocation from 1.0.11.
- Added support for SQL_SEND_LEN_DATA_AT_EXEC parameters. This fixed updating of blobs in Access.
- Enlarged communication buffer to 16384.
1.0.11
- Some statement fields where not cleared in SQLGetColumns and SQLTables.
This resulted in failed second queries.
- Implemented SQLGetStmtOption. (Needed for Access)
- SQLStatistics returned wrong column count.
- Changed default types for SQLStatistics and SQLColumns. (I hate ODBC default types!)
- Added lots of more debug statements.
- Fixed parameter bug in SQLExecute (found by Giovanni).
- Fixed some definition bugs in SQLFreeStmt.
- Tested with Access: The following should work:
Attach (link tables), search, insert, delete and update.
1.0.10
- Changed return of SQLGetInfo SQL_ODBC_API_CONFORMANCE from long to short.
1.0.9
- Update with bind parameters didn't work for strings. This made MSquery fail
on insert and update.
- Added info about all new ODBC functions in server 3.20.0
1.0.7
- Lie that we can handle transactions and set/get cursor names. One should
use ODBC cursors with MyODBC!
1.0.6
- Fixed some small bugs to allow connection from Delphi.
- Fixed windows password bug (passwords should work)
1.0.4
- Added all ODBC level 2 options to SQLGetData + 2 options from ODBC level 1.
- Fixed bug when adding limit to select clause: if SQL_MAX_ROWS was MAX_INT
then limit was set to -1.
近期下载者:
相关文件:
收藏者: