Querying with ADODB::Connection.Execute()-Collection of common programming errors
I’m trying to query an Access database from C++ using the ADODB::Connection class. The
ADODB::Recordset class that
ADODB::Connection.Execute() is fetching into shows this error in its Bookmark property:
Here’s the code snippet:
/***************************************/
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
ADODB::Connection ^ conADO;
String ^ strConnection, ^ strStatement;
Object ^ obj = gcnew Object;
conADO = gcnew ADODB::Connection;
strConnection = (“Provider=Microsoft.ACE.OLEDB.12.0;Data Source=’C:\\Users\\dsk\\Documents\\mydb.accdb’;Persist Security Info=False”);
strStatement = “select * from movies;”;
conADO->Open(strConnection, L””, L””, 0);
ADODB::Recordset ^ pRecordset = gcnew ADODB::Recordset;
pRecordset = conADO->Execute(strStatement, obj, 0); //the message shows up after this statement executes.
/*******************************************/
Any ideas on how to do this query properly are appreciated.
Darrin