Link to home
Start Free TrialLog in
Avatar of Omer-Pitou
Omer-Pitou

asked on

Ador.recordset with MySQL

I am trying to load data into the third-party grid (exontrol), using the command below.
            cStmt="Select * from compte"
            cString = "Provider=MSDASQL.1;Persist Security Info=False;User ID=root;Password=finger4;Data Source=FingerFinanceA10;Initial Catalog=fingerfinance"
            rs = new oleautoclient("ador.recordset")
            rs.open(cStmt, cString,3,3)
                        
            oGrid = form.activex1.nativeObject
            oGrid.ColumnAutoResize = false
            oGrid.ContinueColumnScroll = false
            oGrid.datasource = rs

I am getting this error message
Error:  OLE Dispatch Exception:  The recordset must support the bookmarks. ( Supports( adBookmark ) = True )

It looks like it has something to do with cursortype, cursorlocation. I am not really sure.
The same example works in SQL Server (with a connection string point to SQL server of course),

How can I rewrite my open method to meet this requirement.
SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Omer-Pitou
Omer-Pitou

ASKER

I have my odbc driver installed. I can connect to the database without any problem.
For that specific component, I  need a recorset using ador.recordset which is the one supported so far.
MSDASQL has nothing to do with MySQL.
That is the provider parameter that comes with the connection string. I have been using that connection string to connect to the database. The problem is the recordset generated should include bookmarks, something like that.
http://www.connectionstrings.com/mysql-connector-odbc-5-2/
I think you are still connecting to a MS SQL database, not MySQL.  The connection strings on that page ALL include a reference to the MySQL ODBC provider while yours does not.  "Persist Security Info" and "Initial Catalog" are not used by the MySQL ODBC driver either.
I fixed that, but still getting the same message
Error:  OLE Dispatch Exception:  Current Recordset does not support bookmarks. This may be a limitation of the provider or of the selected cursortype.
This is my connection string
cString = "Provider=MSDASQL; Driver={MySQL ODBC 5.3 Driver}; Server=localhost; Data Source=fingerfinanceA10; User=root;Password=finger4; Database=fingerfinance; option=3"
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
To resolve this, cursorLocation has to be set before the open method