Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Asynchronous SPT
Message
De
14/11/2002 11:15:32
Dan Windus
Nursery Management Systems
Temecula, Californie, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Asynchronous SPT
Divers
Thread ID:
00722707
Message ID:
00722707
Vues:
48
I’ve not been able to find much good documentation on asynch SPT, however in searching the Universal Thread, I came across your comments. I though that I would pass this by you as to whether I’m actually processing correctly. I have very large data sets both in VFP on a back end and against an Informix database, and data rarely comes across complete if at all with normal SPT, so I started playing with asynch. My real question is that when I repeatedly call sqlexec(), I’m not sure how much to include in the parameters. I’d also like to suppress the messages and haven’t found a good method to do that.

Here is code segment that I am currently using.

I’d appreciate any and all suggestions you might have, and would even like to post my accumulated methodology someplace for the benefit of all.

ThisForm.nconnecthandle = SQLCONNECT('EckeMaster')

IF ThisForm.nconnecthandle <= 0
=MESSAGEBOX('Cannot make connection to Server', 16, 'SQL Connect Error')

ThisForm.resetmover()

Return

EndIf

SQLSetProp(ThisForm.nconnecthandle,"Asynchronous",.T.)



lnsuccess=Sqlexec(ThisForm.nconnecthandle, lcsql, 'mainquery')

Do While .T.

If lnsuccess = -1

=MESSAGEBOX('Stock Schedule Query Failed', 16, 'SQL Connect Error')

=SQLDISCONNECT(ThisForm.nconnecthandle)

ThisForm.resetmover()

Return

Endif

If lnsuccess = 0

lnsuccess=Sqlexec(ThisForm.nconnecthandle, lcsql, 'mainquery')

Loop

Endif

If lnsuccess > 0

=SQLDISCONNECT(ThisForm.nconnecthandle)

Exit

Endif

EndDo

ThisForm.nconnecthandle = SQLCONNECT('EckeMaster')

IF ThisForm.nconnecthandle <= 0

=MESSAGEBOX('Cannot make connection to Server', 16, 'SQL Connect Error')

ThisForm.resetmover()

Return

EndIf

SQLSetProp(ThisForm.nconnecthandle,"Asynchronous",.T.)

lnsuccess1 = Sqlexec(ThisForm.nconnecthandle, lcsource, 'mainsource')

Do While .T.

If lnsuccess1 = -1

=MESSAGEBOX('Source Query Failed', 16, 'SQL Connect Error')

=SQLDISCONNECT(ThisForm.nconnecthandle)

ThisForm.resetmover()

Return

Endif

If lnsuccess1 = 0

lnsuccess1 = Sqlexec(ThisForm.nconnecthandle, lcsource, 'mainsource')

Loop

Endif

If lnsuccess1 > 0

=SQLDISCONNECT(ThisForm.nconnecthandle)

Exit

Endif

EndDo



Dan Windus

Nursery Management Systems
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform