Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is it possible to use this in Include file?
Message
 
À
08/11/2004 04:45:00
Christia Jupit Alburo
Witco International Trading Corporation
Caloocan, Philippines
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
00959085
Message ID:
00960532
Vues:
10
Hi Christia,

Just to clarify, you're basically trying to zap an exsisting free table and if it does not exist, to create it. But that the free table sometimes gets corrupted in the process. Is that correct? Try the following modifications:
TRY
   ** Make sure it is not in use
   IF USED("a_counter_inout"
      SELECT a_counter_inout
   ENDIF

   USE a_counter_inout EXCLUSIVE
   *GO TOP   && no need since you're zapping anyways
   ZAP

   CATCH TO tblError
      ** Error could be due to being unable to use exclusively.
      *  Check first before creating the table
      IF tblError.ErrorNo <> 1705
         CREATE TABLE data\a_counter_inout ;
                (release l, ;
                 datein d, ;
                 returned l, ;
                 dateout d, ;
                 remarks c(200), ;
                 coll_date d)
      ENDIF
   FINALLY
      CLOSE TABLES ALL
ENDTRY
For the #DEFINE, put the value in between quotes, i.e.
#DEFINE Create_dt1 "CREATE CURSOR test (lname c(30),fname c(30),mname c(30))"
HTH,
Arriyel

>We well developed a system called IRIS System .. It is integrated system in Sales and Inventory Syste and in Accounting...
>
>For now on i use a free temporary table.. and that i'm using try catch for making them in temporary table.... like this one..
>TRY
>     USE a_counter_inout EXCLUSIVE
>     GO TOP
>     ZAP
>     CATCH TO tblError
>           CREATE TABLE data\a_counter_inout;
>              (release l, ;
>               datein d, ;
>               returned l, ;
>               dateout d, ;
>               remarks c(200),;
>               coll_date d)
>           EXIT
>     FINALLY
>         CLOSE TABLES ALL
>ENDTRY
>
>And i really bad about this because free table sometimes it is corrupted ....
>
>and the question of this... Is it good using this one as a include using a cursor...
>and it is possible to use this..
>
>INCLUDE FILE CONTENTS
>#DEFINE Create_dt1 CREATE CURSOR test (lname c(30),fname c(30),mname c(30))
>
>Command create_dt1
Speak using soft and sweet words in case you have to eat them later.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform