>Hi Everybody,
>
>Does anybody know how to access dbf (VFP 6) files in Visual C++ 6 using ADO? Will you please give me an example.
>
>Thank you very much,
>Ali
CADODatabase AdoDb;
CADORecordset AdoRs;
int numRecords=-1;
CString strConnection = _T("");
strConnection.Format("Provider=vfpoledb;""Data source=%s\\log.dbc;Exclusive=No",m_LinkData.m_directory);
if (AdoDb.Open(strConnection))
{
AdoRs = CADORecordset(&m_AdoDb);
if (AdoRs.Open("varsqueue",CADORecordset::openTable))
{
numRecords = AdoRs.GetRecordCount();
if (numRecords == 0)
return;
while (!AdoRs.IsEof())
{
numRecords = AdoRs.GetRecordCount();
int iid;
CString strVarName;
AdoRs.GetFieldValue("VarName",strVarName);
AdoRs.MoveNext();
}
}
Regards
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only