Page 1 of 1
MySQL, ADO and Browse
Posted: Thu Nov 23, 2006 6:56 pm
by R.F.
Does anybody out there has the correct connection string to make a MySQL Recordset to be "browseable" ??????
I have browsed recordsets of Oracle, ADS, Access, SQL Server, and ALL these using the very same methodology, I mean modifying the movement blocks for the browse, and all worked as expecte, exept mysql.
Any workaround ?
Posted: Thu Nov 23, 2006 8:12 pm
by Rochinha
Hi Rene
look this
Code: Select all
...
StrDatabase := [SGEA]
StrServer := [127.0.0.1]
StrUserID := [root]
StrUserPWD := [root]
StrTable := [pessoas]
StrField := [estado]
StrField2 := [nome]
StrWhere := StrField+[="PR"]
StrConnection := [driver={MySQL ODBC 3.51 Driver};database=]+StrDatabase+[;server=]+StrServer+[;uid=]+StrUserID+[;pwd=]+StrUserPWD+[;option=35]
StrSqlCommand := [SELECT * FROM ] + StrTable + [ WHERE ] + StrWhere
oRs := TOleAuto():New( "ADODB.Recordset" )
oRS:CursorType := adOpenStatic
oRS:CursorLocation := adUseClient
oRS:LockType := adLockPessimistic
oRS:Open( StrSqlCommand, StrConnection, 1, 3 )
...
This help you?
Posted: Thu Nov 23, 2006 8:26 pm
by R.F.
Thanks a lot !!!!!
I was missing the cursor location, I wonder why this was working on other databases.
Posted: Thu Nov 23, 2006 8:34 pm
by Rochinha
Rene
With ADO you can work with various DBs
This is ShowDeBola!!!