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;Persis t Security Info=False;User ID=root;Password=finger4;D ata Source=FingerFinanceA10;In itial Catalog=fingerfinance"
rs = new oleautoclient("ador.record set")
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.
cStmt="Select * from compte"
cString = "Provider=MSDASQL.1;Persis
rs = new oleautoclient("ador.record
rs.open(cStmt, cString,3,3)
oGrid = form.activex1.nativeObject
oGrid.ColumnAutoResize = false
oGrid.ContinueColumnScroll
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
MSDASQL has nothing to do with MySQL.
ASKER
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/
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.
ASKER
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.
Error: OLE Dispatch Exception: Current Recordset does not support bookmarks. This may be a limitation of the provider or of the selected cursortype.
ASKER
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"
cString = "Provider=MSDASQL; Driver={MySQL ODBC 5.3 Driver}; Server=localhost; Data Source=fingerfinanceA10; User=root;Password=finger4
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
To resolve this, cursorLocation has to be set before the open method
ASKER
For that specific component, I need a recorset using ador.recordset which is the one supported so far.