CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 19

Threaded View

  1. #1
    Join Date
    May 2002
    Location
    Mumbai
    Posts
    197

    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 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
  •  





Click Here to Expand Forum to Full Width

Featured