MySQL, ADO and Browse

Post Reply
R.F.
Posts: 840
Joined: Thu Oct 13, 2005 7:05 pm

MySQL, ADO and Browse

Post 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 ?
Saludos
R.F.
Rochinha
Posts: 309
Joined: Sun Jan 08, 2006 10:09 pm
Location: Brasil - Sao Paulo
Contact:

Post 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?
R.F.
Posts: 840
Joined: Thu Oct 13, 2005 7:05 pm

Post by R.F. »

Thanks a lot !!!!!

I was missing the cursor location, I wonder why this was working on other databases.
Saludos
R.F.
Rochinha
Posts: 309
Joined: Sun Jan 08, 2006 10:09 pm
Location: Brasil - Sao Paulo
Contact:

Post by Rochinha »

Rene

With ADO you can work with various DBs

This is ShowDeBola!!!
Post Reply