PC Review


Reply
Thread Tools Rate Thread

Assign Variable Value from Store Procedure

 
 
Steve King
Guest
Posts: n/a
 
      3rd Sep 2003
I've been using the connection execute method to run SQL
Server stored procedures. I would like to be able to
assign a string variable the value of a function or stored
procedure output without having to create an ADODB
recordset to retrieve the value.

The code below uses VB variables as input parameters in
the EXEC statement to return the results of a stored
procedure into a recordset that can be used in VB:

Set PnRS = Cnn.Execute("EXEC spGetPprRecord @PN='" & strPN
& "', @Cage='" & strCage & "'")

I would like to be able to perform something like the
below snippet to assign the return value to the variable
strPprNo.

Dim strPprNo As String
Cnn.Execute ("EXEC " & strPprNo & " =
dbo.fx_GetNextPprNumber @Customer='" & Me.txtCust & "'")

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Assign JavaScript variable to Jsp Variable Ranjan Microsoft ASP .NET 1 10th Apr 2007 04:35 PM
How to assign the value of the java script variable to a server side variable in C# code behind code? ravindravarman@gmail.com Microsoft Dot NET 1 5th Apr 2007 04:04 PM
How to assign the value of the java script variable to a server side variable in C# code behind code? ravindravarman@gmail.com Microsoft Dot NET 0 5th Apr 2007 07:58 AM
How to add a store procedure using vba Dirk Goldgar Microsoft Access Forms 1 11th Mar 2007 08:35 PM
SQL Server Store Procedure returning data from a temp table or a table variable to Access anasser Microsoft Access 1 21st Oct 2005 03:55 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:56 PM.