MyODBC With VB: DAO

MyODBC With VB: DAO

am 18.03.2006 13:35:31 von Wolfgang Fuertbauer

Want to migrate a big application from MS Access to MySql;
Mysql 5.x running on Window, stable ODBC Driver installed and tested
(with Access)

now I try to run the sample from the docs:

>Private Sub myodbc_dao_Click()
>
>Dim ws As Workspace
>Dim conn As Connection
>Dim queryDef As queryDef
>Dim str As String
>
>'connect to MySQL using MySQL ODBC 3.51 Driver
>Set ws = DBEngine.CreateWorkspace("", "venu", "venu", dbUseODBC)
>str = "odbc;DRIVER={MySQL ODBC 3.51 Driver};"_
> & "SERVER=localhost;"_
> & " DATABASE=test;"_
> & "UID=venu;PWD=venu; OPTION=3"
>Set conn = ws.OpenConnection("test", dbDriverNoPrompt, False, str)
>
>'Create table my_dao
>Set queryDef = conn.CreateQueryDef("", "drop table if exists my_dao")
>queryDef.Execute
>
>Set queryDef = conn.CreateQueryDef("", "create table my_dao(Id INT AUTO_INCREMENT PRIMARY KEY, " _
> & "Ts TIMESTAMP(14) NOT NULL, Name varchar(20), Id2 INT)")
>queryDef.Execute

>Insert new records using rs.addNew
>Set rs = conn.OpenRecordset("my_dao")

everything works fine until then "conn.openrecordset(" ..

this ends in an VB Runtime error: 3146 ODBC Error

Who can help please ?


--
------------------------------------------------------------ ---------
Wolfgang Fürtbauer Tel: +43 7612 77620
Steinbichlstrasse 58d Mobil: +43 664 8397987
4812 Pinsdorf E-Mail: w.fuertbauer@utanet.at
Austria


--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe: http://lists.mysql.com/myodbc?unsub=gcdmo-myodbc@m.gmane.org