Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Non ui sql query
Message
From
26/02/2003 09:35:24
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00714257
Message ID:
00758049
Views:
32
VFP's SQL Select outputs information to the user display to show the progress of the sql call. In a DLL of course, this is not allowed. Turning off talk and notify, will kill any attempt by VFP to output to the user display.

Alan

>How can this be the solution? TALK and NOTIFY can't create a modal state in the dll. SAFETY could if the select statement selected into a table which already existed.
>I have a similar problem. In my MTDLL there is a loop which does SQLEXEC statements like this one:
>
>This.pcDataCursor = 'f' + Sys(2015)
>lnResult = SqlExec(This.pnDbHandle, lcSp, This.pcDataCursor)
>
>pnDbHandle is always the same, lcSP is the stored proc to be executed and pcDataCursor is a unique cursor name. The connection has the Asynchronous property set to False. The loop goes right many times, but every now and then I receive a "UI operation not allowed" error. The stored proc which is executed works fine if I try it in the query ananlyser right after the error occurs. The SQLExec function returns nothing in the case of this error, lnResult remains .F. (is not yet initialized).
>
>I'll try this fix, but even if it works I'd like to understand why this is happening.
>
>
>>Try adding these lines to the Init
>>
>>
>>DEFINE CLASS vfpsqlcoms AS session OLEPUBLIC
>>PROCEDURE Init
>>   SET TALK OFF
>>   SET NOTIFY OFF
>>   SET SAFETY OFF
>>ENDPROC
>>
>>PROCEDURE SQLPROCESS(cSQLx)
>>   &cSQLx
>>   return
>>ENDPROC
>>
>>ENDDEFINE
>>
Previous
Reply
Map
View

Click here to load this message in the networking platform