sqlexec

This forum is meant for questions about the Visual FoxPro Language support in X#.

Post Reply
jpmoschi
Posts: 77
Joined: Thu May 21, 2020 3:45 pm

sqlexec

Post by jpmoschi »

hi Forum
I have a problen with sqlexec function
LRESULT = SqlExec(_HANDLE, "Select getdate() dummy ","dummyselect",miarray )
Lresult is -1 but i am shure, some sql command are correctly executed because I checked it in my MS SQL Profiler.but
In VFP, when sqlexec returns lest than 0 the aerror() function returns an array with the error description.
how can i check what is hapened ? ¿any Ideas?
User avatar
robert
Posts: 4558
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

sqlexec

Post by robert »

Juan,
This should work. I am not sure why it fails.
And yes, we do not have the AError() function yet,
But you can retrieve the last error (an object of type Exception) by accessing XSharp.RuntimeState.LastRddError

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
jpmoschi
Posts: 77
Joined: Thu May 21, 2020 3:45 pm

sqlexec

Post by jpmoschi »

my problem is: the CLR does'nt find the DLLs. In Console application i puted the dll in the folder bindebug and it functioned ok.
But in the template project Windows Form VFP the same solution do not correct the problem.
I not prefer to use GAC never. How could i resolve all dll locations in debug mode ?
My IDE is VS Professional 2015)
User avatar
robert
Posts: 4558
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

sqlexec

Post by robert »

Juan,
We really recommend using the GAC on your development machine.
It is easy and it works.

If you don't want to use the GAC then we recommend you add references in your project to all DLLs that you need, including XSharp.RDD, XSharp.Macrocompiler and set the property in VS to copy the DLLs to the output folder.

You can also copy the Redist subfolder from the X# directory to your output directory. If you do not use the VO compatible SDK classes you can omit the files that start with "VO"

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
Post Reply