Show columns from table like "field" and odbc 3.51.12
am 21.04.2006 16:15:35 von RAPPAZ Francois
Hello list
I would like to get the enum or set members from a field in ms access, =
and connect to mysql using ADO. The recordset is made without problem =
but the Type field is truncated in the recordset. Is there a work around =
?
I tried to loop in the recordset, but it's no use.
here is my code:
Dim Cnt As New ADODB.Connection
Dim Rec As New ADODB.Recordset
Cnt.Open _
"DRIVER=3D{MySQL ODBC 3.51 Driver};" & _
"SERVER=3Dwww.unifr.ch;" & _
"DATABASE=3D...;" & _
"USER=3D...;" & _
"PASSWORD=3D...;"
=20
SQL =3D "SHOW COLUMNS FROM `jrn` LIKE 'dom'"
Rec.CursorLocation =3D adUseClient
Rec.Open SQL, Cnt, adOpenKeyset, adLockOptimistic
Rec.MoveFirst
Do While Not Rec.EOF
=20
Debug.Print Rec!Type
Rec.MoveNext
Loop
=20
Thanks for any help !
Fran=E7ois Rappaz
--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe: http://lists.mysql.com/myodbc?unsub=3Dgcdmo-myodbc@m.gmane.o rg
RE: Show columns from table like "field" and odbc 3.51.12
am 24.04.2006 01:52:34 von jbonnett
I tried your code, modifying it a little to suit my database and it =
seems to work just fine.
Listing all the columns from one of my tables gave this result
int(11)
varchar(5)
varchar(255)
int(11)
int(11)
int(11)
float
float
float
float
float
float
float
int(11)
float
float
What exactly were you getting?
John Bonnett
=20
Computer Scientist
Product R&D
Carl Zeiss Vision GmbH
Lonsdale, South Australia
=20
Phone: +61 8 8392 8366
Fax: +61 8 8392 8400
Email: jbonnett@czv.com.au
http://www.carlzeissvision.com/
This email, including any attachments, is intended for the sole use of =
the intended recipient(s) and may contain information=20
that is confidential, privileged and/or the sender's work. Any review or =
distribution by any other person is prohibited. If you=20
are not an intended recipient, please immediately contact the sender and =
delete all copies.
-----Original Message-----
From: RAPPAZ Francois [mailto:francois.rappaz@unifr.ch]=20
Sent: Friday, 21 April 2006 11:46 PM
To: myodbc@lists.mysql.com
Subject: Show columns from table like 'field' and odbc 3.51.12
Hello list
I would like to get the enum or set members from a field in ms access, =
and connect to mysql using ADO. The recordset is made without problem =
but the Type field is truncated in the recordset. Is there a work around =
?
I tried to loop in the recordset, but it's no use.
here is my code:
Dim Cnt As New ADODB.Connection
Dim Rec As New ADODB.Recordset
Cnt.Open _
"DRIVER=3D{MySQL ODBC 3.51 Driver};" & _
"SERVER=3Dwww.unifr.ch;" & _
"DATABASE=3D...;" & _
"USER=3D...;" & _
"PASSWORD=3D...;"
=20
SQL =3D "SHOW COLUMNS FROM `jrn` LIKE 'dom'"
Rec.CursorLocation =3D adUseClient
Rec.Open SQL, Cnt, adOpenKeyset, adLockOptimistic
Rec.MoveFirst
Do While Not Rec.EOF
=20
Debug.Print Rec!Type
Rec.MoveNext
Loop
=20
Thanks for any help !
Fran=E7ois Rappaz
--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe: http://lists.mysql.com/myodbc?unsub=3Dgcdmo-myodbc@m.gmane.o rg