Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling VFP UDF from Ole db

Status
Not open for further replies.

WIREMESH

Programmer
Mar 15, 2004
109
US
In my ASP.NET web application I query FREE tables. In one instance I want to run a query that calls a udf.

Ex. WHAT I want to run
sql = "select lastname FROM EMPLOYEE WHERE status =1 AND MYUDFFUNCTION() = 1"

Conceptually, I want to do this:

SET PROCEDURE TO C:\TEMP\UDFS.PRG

Inside UDFS.PRG will be a bunch of fuctions.
function my_udf_function()
return 1


SAMPLE CODE

dstTemp = New DataSet()
sql="SET PROCEDURE TO C:\temp\UDFS.PRG", connection_string)
dbCon = New OleDbConnection(connection_string)
cmdUpdate = New OleDbCommand(SQL, dbCon)
dbCon.Open()
record_count = cmdUpdate.ExecuteNonQuery()

I get an error trying to run the SET PROCEDURE COMMAND
 
The syntax of this line looks a bit strange:

sql="SET PROCEDURE TO C:\temp\UDFS.PRG", connection_string)

Off the top of my head, I would think it should simply be:

sql="SET PROCEDURE TO C:\temp\UDFS.PRG"

I'm not sure if that will solve your problem, but I suggest you give it a try.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top