Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can I create a VIEW from a free table?
Message
De
19/04/1999 13:42:25
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00209037
Message ID:
00209767
Vues:
22
>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
------------
Hey ED... thanks for the code...In my network compatable apps, I have been using views for my Buffering and then writing the views back to the table to save the changes. Is this the way to go about it or shoudl I just use Buffering with
cusorsetprop()?
Robert Keith
Independent Developer
San Antonio, Texas
E-mail address:
rebelrob1@yahoo.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform