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
>>