Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VFP ODBC driver

Status
Not open for further replies.

chpicker

Programmer
Apr 10, 2001
1,316
Has anyone ever tried to use the VFP ODBC driver in Visual C++? I tried making a quick app using the MFC wizard, and it worked...mostly.

I created an ODBC object for my database in the control panel, chose one of the tables in the database to link the app to, and threw a few fields on a dialog for browsing through. This particular table has over 160,000 records of 1k each. When I launch the app that was made, it loads the WHOLE TABLE into memory before displaying the app! This takes awhile for a 160 meg table! After loading, everything worked as expected, but it's that load time that bugs me. Is there something I'm missing here? Is it an ODBC issue? Is there something I need to put in the code to make it only load the record(s) it's using into memory?

Also, when I have the table set to load as a DYNASET, I get the error "ODBC driver does not support dynasets". I assume this means you CANNOT use a Dynaset with the VFP ODBC driver. This is rather annoying, but is there any way around that? Snapshots don't seem to be the right solution for me since the app I'm trying to develop needs to update various displays in real time. Requerying every time the record pointer moves seems like an awful waste, and sometimes the data changes need to be displayed even if the record pointer DOESN'T move. Any suggestions?

I saw an MSDN article that said the preferred method of accessing VFP tables was through VFP DB OLE (or something like that). How do you set that up?
 
I don't have an answer for you with regards VFP and ODBC, but I can tell you that Visual FoxPro 7 (the latest version that just came out a few months ago) includes a VFP OLE driver. Given that you should be able to use ADO and VC++ to access your data.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top