Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Pass a web variable to a stored procedure
Message
From
30/01/2008 04:08:15
 
 
To
29/01/2008 16:28:55
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
01257541
Message ID:
01287019
Views:
56
This message has been marked as a message which has helped to the initial question of the thread.
>>>>Probably, that's what Cetin recommended. But wouldn't know how to return the value to ASP.
>>>
>>>Here's a SP Example lifted from the web:
>>>** sp_insert
>>>PARAMETERS value
>>>SET NULL OFF
>>>INSERT INTO table1 (field1) VALUES (m.value)
>>>CREATE CURSOR result (result i)
>>>INSERT INTO result VALUES (GetAutoincValue())
>>>RETURN SETRESULTSET("result")
>>>
>>
>>AFAIK you don't need it as a resultset and may return it as an output parameter. Should work the same, I think.
>
>Naomi and Viv
>Both of you (and Cetin) have been very patient and kind on this issue. Thanks. I find my problems are not so much with VFP but with my unfamiliarity with ASP and how to structure its commands. ASsuming I wrote a SP that RETURNED the value I need, how would you call it from ASP and capture the value? Is this it?
>
>x = oConn.Execute("EXEC 'do myStoredProc'")

Just:
x = oConn.Execute('myStoredProc')
or, if your SP takes parameters something like:
x = oConn.Execute('myStoredProc("AStringValue")')
The return value will always be an ADODB.RecordSet. If your SP returns a single value you can grab it from the first column of the first row :
x.Fields(0).Value
An example of iterating a Recordset in ASP here:http://fox.wikis.com/wc.dll?Wiki~VFPOleDBProvider~VFP
Details on the Recordset here:http://technet.microsoft.com/en-us/library/ms681510(VS.85).aspx


HTH,
Viv
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform