I am simply trying to Open a Recordset, but it is returning me error..
Here is a part of my code:
void MyFunction(_ConnectionPtr ConnPtr) {
_RecordsetPtr RecPtr;
std::string command = "Select * from MYTABLE";
RecPtr.CreateInstance(__uuidof(_Recordset));
RecPtr->Open(command.c_str(), ConnPtr.GetInterfacePtr(), adOpenStatic, adLockOptimistic, adCmdText);
//ERROR!!!!!!!
}
int main(int argc, char** argv) {
CoInitializeEx(NULL, COINIT_MULTITHREADED)
_ConnectionPtr ConnPtr;
ConnPtr.CreateInstance("ADODB.Connection");
ConnPtr->Open(....my Connection String, UserID, and Password....);
MyFunction(ConnPtr);
::CoUninitialize();
ConnPtr->Close();
}
The Error Message:
Code = 80004003
Code Meaning = I
Source = <null>
Description = <null>
dd
(The description says nothing.. and also I have no idea what "I" means or why "dd" is printed out at the end,,)
There is nothing wrong with the connection string, userID, and Password, since opening the connection ptr returns no error. The error occurs when I try to open the Recordset.. Can anyone find a problem in my code?
Thanks