Hi all
I have a program that accesses a access db. I have gotten the program to insert records into the db, but I cant get the records to display in the dialog? Are record sets limited to the amount of fields they can read from the db, or is there perhaps something in my code that is causing this?
below is my code where I connect to the db:
m_strConnection = _T("DSN=Report_prg");
m_strCmdText = _T("Select * From R_tbl");
m_pConnection = NULL;
m_pCommand = NULL;
m_pRs = NULL;
m_piADORecordBinding = NULL;
try
{
::CoInitialize(NULL);
m_pConnection.CreateInstance (__uuidof(Connection));
m_pCommand.CreateInstance (__uuidof(Command));
m_pRs.CreateInstance(__uuidof(Recordset));
m_pRs->Open(LPCTSTR(m_strCmdText),LPCTSTR(m_strConnection),adOpenDynamic,adLockOptimistic,adCmdUnknown);
if(FAILED(m_pRs->QueryInterface(__uuidof(IADORecordBinding),(LPVOID*)&m_piADORecordBinding)))
_com_issue_error(E_NOINTERFACE);
m_piADORecordBinding->BindToRecordset(&m_rsRecSet);
RefreshBoundData();
}
catch(_com_error &e)
{
GenerateError(e.Error(),e.Description());
}
Any help would be appreciated!
Thanx
I have a program that accesses a access db. I have gotten the program to insert records into the db, but I cant get the records to display in the dialog? Are record sets limited to the amount of fields they can read from the db, or is there perhaps something in my code that is causing this?
below is my code where I connect to the db:
m_strConnection = _T("DSN=Report_prg");
m_strCmdText = _T("Select * From R_tbl");
m_pConnection = NULL;
m_pCommand = NULL;
m_pRs = NULL;
m_piADORecordBinding = NULL;
try
{
::CoInitialize(NULL);
m_pConnection.CreateInstance (__uuidof(Connection));
m_pCommand.CreateInstance (__uuidof(Command));
m_pRs.CreateInstance(__uuidof(Recordset));
m_pRs->Open(LPCTSTR(m_strCmdText),LPCTSTR(m_strConnection),adOpenDynamic,adLockOptimistic,adCmdUnknown);
if(FAILED(m_pRs->QueryInterface(__uuidof(IADORecordBinding),(LPVOID*)&m_piADORecordBinding)))
_com_issue_error(E_NOINTERFACE);
m_piADORecordBinding->BindToRecordset(&m_rsRecSet);
RefreshBoundData();
}
catch(_com_error &e)
{
GenerateError(e.Error(),e.Description());
}
Any help would be appreciated!
Thanx