Problem opening database
am 23.12.2005 18:07:22 von Les Stockton------=_Part_4271_24007192.1135357642432
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
I have used this code and have successfully connected to the MySQL server.
For some reason, however, it doesn't seem to know that I have connected to =
a
particular database.
Be aware that DB is an ADODB.Connection object in VB6
DB.ConnectionString =3D "DRIVER=3D{MySQL ODBC 3.51 Driver};" _
& "Location=3D" & SQLServerName _
& "Initial Catalog=3D" & UCase(DatabaseName) _
& "Data Source=3D" & UCase(DatabaseName) _
& "OPTION=3D" & 4 + 16 + 524288
DB.Properties("User ID").Value =3D SQLUserName
DB.Properties("Password").Value =3D SQLPassword
DB.CursorLocation =3D adUseClient
DB.CommandTimeout =3D 300
DB.Open
The connectionString ends up as:
Provider=3DMSDASQL.1;Password=3Dxyz;User ID=3Droot;Data
Source=3DTestCreate;Location=3Dlocalhost;Extended Properties=3D"DRIVER=3D{M=
ySQL ODBC
3.51 Driver};OPTION=3D524308"
It does believe the connection is done, and I can do queries if I put the
database.table together when selecting on a particular table. However, jus=
t
specifying the table name, I get "no database selected".
I specify the database in "Initial Catalog" and in "Data Source". Not sure
what to do to get this to work.
--
Les Stockton
3844 Cincinnati Avenue
Winchester, Ok 74421
-----
You do dat, you go to da box, you know, uh, two minutes by yourself, and yo=
u
feel shame, you know, and then you get free. ~Denis Lemieux
------=_Part_4271_24007192.1135357642432--