General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
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
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only