Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Title:
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01055622
Message ID:
01055675
Views:
9
Ok,

Here's the problem with my previous code, if there are no parameters present in your stored procedure, the OLEDB provider doesn't create the parameters object. I've tried to manually create the parameters object but haven't had much success. Here's a version that does work, however, you must pass in at least one parameter.
loConn = CREATEOBJECT('ADODB.Connection')
loConn = GetConnString()
loConn.Open()

loCmd  = CREATEOBJECT('ADODB.Command')
WITH loCmd
	.ActiveConnection = loConn
	.CommandType = 4              && Stored Procedure
	.CommandText = 'sp_test'
	.Parameters(1).Value = 'apl1keh'  && Need to pass at least one parameter to sp
ENDWITH

loCmd.Execute()

? loCmd.Parameters(0).Value
and the stored procedure:
alter PROCEDURE sp_test 
      @user_id   varchar(10)    AS

RETURN 33
Kurt


>This lvRetVal = loCmd.Parameters(0).Value gives error
>"Member PARAMETERS does not evaluate to an object"
Previous
Reply
Map
View

Click here to load this message in the networking platform