January 4th, 2005, 06:33 PM
#1
Error in Recordset
Following peice of code is giving error as in attachment, please help
#include "stdafx.h"
#include <iostream.h>
#include <afxdb.h>
int main(int argc, char* argv[])
{
CDatabase myDatabase;
CString strConnect;
strConnect = _T("DSN=DB110_32;User Id=#ISL1Q1;PASSWORD=SYSLOG01;SRVR=DB110;DB=ccyud001;UID=#ISL1Q1;");
try
{
myDatabase.OpenEx(strConnect);
}
catch(...)
{
cout << "Error in opening Database" << endl;
return 0;
}
cout << "connection is successful" << endl;
try
{
CRecordset rs(&myDatabase);
rs.m_strSort = "proj_num, contact_name";
rs.Open(CRecordset: ynaset,_T("ccy003_proj"));
rs.Close();
}
catch(...)
{
cout << "again some error in rs" << endl;
return 0;
}
myDatabase.Close();
return 0;
}
Attached Files
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