Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can I create a VIEW from a free table?
Message
 
To
16/04/1999 12:08:29
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00209037
Message ID:
00209630
Views:
23
Robert,
Yes you can, I use this technique to create updatable sql selects from free tables.

The trick is to create a temporary DBC in and destroy it when finished. The actual DBF will remain a free table, since you have to open it exclusive for VFP to mark it as contained

For example:

Procedure ViewFromTable
Parameters cQueryToExecute, cCursorName
Local cQry, cTempDBC

cTempDBC = SYS(2023) + "\TEMP.DBC"
IF !FILE(cTempDBC)
CREATE DATABASE (cTempDBC)
ELSE
IF !DBUSED(cTempDBC)
OPEN DATABASE (cTempDBC)
ELSE
SET DATABASE TO (cTempDBC)
ENDIF
ENDIF

cQry = "CREATE SQL VIEW " + RTRIM(cCursorName) + " AS " + cQueryToExecute
&cQry
USE (cCursorName) IN 0
RETURN
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform