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.
Omer-PitouAsked:
Who is Participating?
 
Omer-PitouAuthor Commented:
This solved my problem
rs = new oleautoclient("ador.recordset")
rs.cursorLocation = 3
rs.open(cStmt, cString,3,3)
0
 
Dave BaldwinFixer of ProblemsCommented:
First, if you really are using MySQL and not MS SQL, you need to instal the MySQL ODBC driver.  http://dev.mysql.com/downloads/connector/odbc/

Example code can be found on these pages:
http://dev.mysql.com/doc/connector-odbc/en/connector-odbc-examples.html
http://dev.mysql.com/doc/connector-odbc/en/connector-odbc-examples-programming.html
0
 
Omer-PitouAuthor Commented:
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.
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
Dave BaldwinFixer of ProblemsCommented:
MSDASQL has nothing to do with MySQL.
0
 
Omer-PitouAuthor Commented:
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/
0
 
Dave BaldwinFixer of ProblemsCommented:
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.
0
 
Omer-PitouAuthor Commented:
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.
0
 
Omer-PitouAuthor Commented:
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"
0
 
Omer-PitouAuthor Commented:
To resolve this, cursorLocation has to be set before the open method
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.