Professional Documents
Culture Documents
Getting The Most Out of MyODBC
Getting The Most Out of MyODBC
Venu Anuganti
Developer, MySQL Inc
© MySQL AB 2003
© MySQL AB 2003 | Venu Anuganti | www.mysql.com
MySQL™: Getting most out of Connector/ODBC
Presentation Goals
• ODBC
– Overview
– Fundamentals
– Architecture
• Connector/ODBC
– Installation
– Connection Options
– Supported and Unsupported Features
– How to use with Microsoft Access
– How to use with Open Office
– How to use in the .NET environment
– Migrating from other Databases
– Current status and TODO
© MySQL AB 2003 | Venu Anuganti | www.mysql.com
MySQL™: Getting most out of Connector/ODBC
ODBC Overview
ODBC Solution
• Requirements
– Access Multiple DBMSs
• using same source code without recompiling and relinking
• Simultaneously
– Which DBMS features should ODBC expose ?
• Common to all DBMSs
• Any feature that is available in any DBMS
• Solves
– It is a Call Level Interface(CLI)
– Defines Standard SQL Grammar
– Driver Manager -> simultaneous access to multiple DBMSs
– Feature Set
© MySQL AB 2003 | Venu Anuganti | www.mysql.com
MySQL™: Getting most out of Connector/ODBC
ODBC Architecture
Application
ODBC API
Driver Manager
ODBC API
Connector/ODBC
Installation
• Windows
– From Binary distribution
– From Source
• Unix
– From Source
--with-mysql[-libs/includes]
--with-iodbc[..]
--with-unixODBC[..]
– From Binary distribution
© MySQL AB 2003 | Venu Anuganti | www.mysql.com
MySQL™: Getting most out of Connector/ODBC
Connector/ODBC Options
Connection Options
• What is the need of them ?
© MySQL AB 2003 | Venu Anuganti | www.mysql.com
MySQL™: Getting most out of Connector/ODBC
Bit Description
1 Returns the real width of a column.
Returns the true value of affected rows. If this flag is set
2 then MySQL returns 'found rows' instead. One must have
MySQL 3.21.14 or newer to get this to work.
Make a debug log in `c:\myodbc.log'(`/tmp/myodbc.log').
This is the same as putting
4
MYSQL_DEBUG=d:t:O,c::\myodbc.log in
`AUTOEXEC.BAT'
8 Don't set any packet limit for results and parameters.
Don't prompt for questions even if driver would like to
16
prompt
32 Enable or disable the dynamic cursor support.
© MySQL AB 2003 | Venu Anuganti | www.mysql.com
MySQL™: Getting most out of Connector/ODBC
• ODBC.INI
[myodbc3-test]
Driver = /usr/local/lib/libmyodbc3.so
Description = Connector/ODBC 3.51 Driver DSN
SERVER = localhost
PORT =
USER = root
Password =
Database = test
OPTION =3
SOCKET =
• ODBCINI and ODBCSYSDIR
© MySQL AB 2003 | Venu Anuganti | www.mysql.com
MySQL™: Getting most out of Connector/ODBC
Remote Connection
• Setup DSN with the server name pointing to the
hostname that you want to connect
• Establish a connection
© MySQL AB 2003 | Venu Anuganti | www.mysql.com
MySQL™: Getting most out of Connector/ODBC
– WinSQL (http://www.indussoft.com/)
– Open Offfice (http://www.openoffice.org/)
– Microsoft Visual Database Project
© MySQL AB 2003 | Venu Anuganti | www.mysql.com
MySQL™: Getting most out of Connector/ODBC
• In the Export Object Type 'Object name' To dialog box, in the Save As Type
box, click ODBC Databases ()
• Reasons for
– #DELETED
– Write conflict
– Row can’t be found for updating/deleting
• Work around
© MySQL AB 2003 | Venu Anuganti | www.mysql.com
MySQL™: Getting most out of Connector/ODBC
• Setup
– Microsoft .NET Framework SDK
– MDAC 2.6 or later (2.7 is recommended)
– ODBC.NET Provider (Microsoft.Data.Odbc name space)
• Installed to “C:\Program
Files\Microsoft.NET\Odbc.Net”
© MySQL AB 2003 | Venu Anuganti | www.mysql.com
MySQL™: Getting most out of Connector/ODBC
ODBC.NET Architecture
ODBC.NET Application
ODBC.NET API
ODBC.NET Provider
ODBC API
Data Data
MySQL
Source Source
© MySQL AB 2003 | Venu Anuganti | www.mysql.com
MySQL™: Getting most out of Connector/ODBC
Migrating
• MS Access
• MS Data Transformation Services (DTS)
• Export to plain SQL
© MySQL AB 2003 | Venu Anuganti | www.mysql.com
MySQL™: Getting most out of Connector/ODBC
Connector/ODBC 3.52
• ODBC Specification 3.51/3.52
• MySQL 4.1 Binary Protocol compatible
• Unicode APIs
• Descriptors
• Array Parameter Handling
• Performance
• Existing major bugs ( if any ) from 3.51
• Alpha release
© MySQL AB 2003 | Venu Anuganti | www.mysql.com
MySQL™: Getting most out of Connector/ODBC
Questions ?
• Mailing list:
myodbc@lists.mysql.com
• List Archives:
http://lists.mysql.com/