Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ADO and VFP 6
Message
General information
Forum:
Visual C++
Category:
ActiveX
Title:
Miscellaneous
Thread ID:
00861533
Message ID:
00866900
Views:
21
>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
Map
View

Click here to load this message in the networking platform