Hi,
I am using DAO in which I am trying to execute an SQL query in MS ACCESS 2007 containing more than 260 characters. And as such the query fails to execute. I need to execute an query which is more than 260 characters in length. I am using C/C++. Kindly help.
static DAO::_DBEngine* pEngine = NULL;
static DAO::DatabasePtr pDbPtr = NULL;
_bstr_t dbFile ="C:\\ObjectInfo.accdb";
hr = CoCreateInstance(
__uuidof(DAO::DBEngine),
NULL,
CLSCTX_ALL,
IID_IDispatch,
(LPVOID*)&pEngine);
if (SUCCEEDED(hr) && pEngine)
pDbPtr = pEngine->OpenDatabase(dbFile);
_bstr_t query = "INSERT INTO mytable VALUES( 4,0,12289,0,0,0,0,0,0,0,0,0,0,1,0,"C:\TEST1\fld_L1","null","null","null","null")";
pDbPtr->Execute(query);
The above query will execute successfully if the length of query is <260 chars. But Fails on larger query.
Thank you.