Click here to Skip to main content
15,902,299 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
#include "sql.h"
#include "Windows.h"

in OnRead() function

SQLRETURN rc;
CDatabase database;
CString strName,SqlString;
CString sCatID, sCategory,Username;
CString sDriver = "MICROSOFT ACCESS DRIVER (*.mdb)";
CString sDsn;
CString sFile = "E:\\Truck.mdb";
int iRec = 0;
sDsn.Format("ODBC;DRIVER={%s};DSN='';DBQ=%s",sDriver,sFile);
TRY
{
database.Open(NULL,false,false,sDsn);


rc = SQLAllocEnv(database);
C#
SqlString =  "SELECT * FROM Trucklogin";

            rc=SQLExecute("SELECT * from Trucklogin");
            //database.ExecuteSQL(rc);
            AfxMessageBox(rc);

           
            recset.Open(CRecordset::forwardOnly,SqlString,CRecordset::readOnly);

C#
CATCH(CDBException, e)
    {
        
        AfxMessageBox("Database error: "+e->m_strError);
    }
    END_CATCH;



how to find whether the values are accessing fron table or not??
please help me with some code.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900