>>The simple and obvious answer is that you need everything (the whole script) as a one command for execsript (with CRLF between each VFP command), not each command as a separate execscript since each of them is executed in its own environment and has no idea about previous execscript command.
>>
>>Cetin showed an example here and in MSDN forum how to invoke one long command.
>>
>>You may check this thread at MSDN
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1771883&SiteID=1 for the sample of executing long text.
>
>Thanks for the info
>
>I have checked the link. This is dedicated to an OleDb provider. My data class is generic so it will fit with several providers. See the other threads I just started in order to obtain a generic way. As is, it works. Thanks for the information of that link which demonstrates that it works. However, as this point, I need to proceed and find a way to have this working with a IDbCommand declaration instead.
I saw your thread. I have no knowledge of the topic, unfortunately, so I hope someone else will jump in.
BTW, Execscript will only work with OleDb. May be you can subclass your data class?
If it's not broken, fix it until it is.
My Blog