Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do try again if an insert fails?
Message
De
01/04/2003 11:27:28
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
01/04/2003 11:06:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00772428
Message ID:
00772440
Vues:
4
This message has been marked as the solution to the initial question of the thread.
>I have a bit of code that inserts a record into a table. The problem is that there is an external program, that i did not write, that requires exclusive use of that table. occasionally there is an error, when they bump heads.
>
>I would like to add some sort of trap that would test to see if the table is available at that moment, if it's not then try again several times before erroring out or succeeding.
>
>********************************
>Insert into 'i:\data\ecnc\data\bcexclusive.dbf' (fnction, forg_date, ;
>	forg_time, fdate, ftime, fempno,;
>	fjobno, foperno, fcompqty, fscrpqty, flead, fsetup, frework);
>	values (cFunction, cdate, cOrg_Time,;
>	cdate, cTime, cEmpNo,;
>	cJobNo, cOpNo, nCompleted, 0, 'Y', cSetup, 'N')	
>use in bcexclusive &&Close table. bcposting needs exclusive use
>*********************************
>
>Oh, by the way, how do i highlight my code above, for the post here on UT?
lcFile = 'i:\data\ecnc\data\bcexclusive.dbf'
lnHandle = -1
do while lnHandle < 0
 lnHandle = fopen(lcFile,12)
enddo
fclose(lnHandle)
insert ....
Include your code between < PRE >, < /PRE > tags to highlight.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform