-
January 21st, 2013, 01:31 AM
#1
Out of Memory and driver could not be loaded due to system error 8
I am getting "driver could not be loaded due to system error 8" error while connecting to SQL Server 2005 from VC++. Its also throwing out of memory error. Basically i am developing and ISAPI dll. I use the following code to connect to DB.
CDatabase DBConnection;
if(! DBConnection.IsOpen())
{
DBConnection.OpenEx("Driver={SQL Server};Server=10.120.110.30;Database=Test;Trusted_Connection=yes;", CDatabase:penReadOnly | CDatabase::noOdbcDialog);
}
CRecordset RecSet(&DBConnection);
RecSet.Open(CRecordset::forwardOnly,_T("{CALL SP_GetDetails('" + Username +"','403')}"));
while(!RecSet.IsEOF())
{
RecSet.GetFieldValue((short)0,strValue);
RecSet.MoveNext();
}
RecSet.Close();
DBConnection.Close();
I am new to C++. Can anybody please help to verify my code?. Also, for CDatabaseConnection, i can see 2 different method to open the connection, OpenEx and Open. Whats the difference between OpenEx and Open?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|