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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dataenvironment

Status
Not open for further replies.

jrajesh

Programmer
Aug 12, 2001
72
HK
Hi VFP-gurus,
I have an application which functions as a viewer (only).
The data for this application is imported on a daily basis.

The application checks for available import files in a particular folder, imports and updates various tables.

For importing, I want to open the database and tables in exclusive mode, import, close them and then reopen them in shared mode.

Could someone please guide me as to how to access the DE programmatically to do this?
Thanks and regards,
Rajesh
 
I'm not sure what you mean by accessing 'the DE programmatically to do this'. All you need to do is add your tables to your database as required, then from a Click event on an 'Import' button you can do something like:

OPEN DATABASE MyDB
IF FILE("ImpFile1") &&... add extension as needed
SELECT 0
USE ImpTable1 EXCLUSIVE
APPEND FROM ImpFile1 &&... SDF if needed
USE ImpTable1 SHARED
ENDIF

IF FILE("ImpFile2") &&... add extension as needed
SELECT 0
USE ImpTable2 EXCLUSIVE
APPEND FROM ImpFile2 &&... SDF if needed
USE ImpTable2 SHARED
ENDIF

And so on for the rest of the tables.

Dave S.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top