Getting a return value from a SP (SQL 2000, VB 6.0) 
Author Message
 Getting a return value from a SP (SQL 2000, VB 6.0)

Very newbie in this field of endeavor...I'm attempting to do something
conceptually really simple, but having a hell of a time figuring it out.

VB procedure that called the sproc, but having no luck at all reading the
variable...

sproc is as follows (please note that sp_table does have an identity column)


AS
insert into sp_table
(exec_time)
values
(getdate())



//------------------------------------------------

The vb code:
    Dim cnActive As New ADODB.Connection
    dim ConnectString as String

    ConnectString = "uid=sa;pwd=sa;dsn=dsn;database=db"
    With cnActive
        .ConnectionString = ConnectString
        .Mode = adModeReadWrite
        .Open
    End With

    Dim Qy As ADODB.Command
    Set Qy = New ADODB.Command
    With Qy
        .ActiveConnection = cnActive
        .CommandText = "sptest"
        .CommandType = adCmdStoredProc
    End With


Thanks very much in advance for any guidance that you might be able to
provide...



Sat, 27 Mar 2004 06:20:22 GMT  
 Getting a return value from a SP (SQL 2000, VB 6.0)

parameter 0
.
.
.
    With Qy
        .ActiveConnection = cnActive
        .CommandText = "sptest"
        .CommandType = adCmdStoredProc
        .Parameters.Refresh
        .Execute
    End With


--
Charles W. Sharpe, Jr.




Quote:
> Very newbie in this field of endeavor...I'm attempting to do something
> conceptually really simple, but having a hell of a time figuring it out.

the
> VB procedure that called the sproc, but having no luck at all reading the
> variable...

> sproc is as follows (please note that sp_table does have an identity
column)

> create procedure sptest

> AS
> insert into sp_table
> (exec_time)
> values
> (getdate())



> //------------------------------------------------

> The vb code:
>     Dim cnActive As New ADODB.Connection
>     dim ConnectString as String

>     ConnectString = "uid=sa;pwd=sa;dsn=dsn;database=db"
>     With cnActive
>         .ConnectionString = ConnectString
>         .Mode = adModeReadWrite
>         .Open
>     End With

>     Dim Qy As ADODB.Command
>     Set Qy = New ADODB.Command
>     With Qy
>         .ActiveConnection = cnActive
>         .CommandText = "sptest"
>         .CommandType = adCmdStoredProc
>     End With


> Thanks very much in advance for any guidance that you might be able to
> provide...



Sat, 27 Mar 2004 12:01:04 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. VB 6.0 - SQL Server - Return Values

2. Getting a return value from a SQL Server stored procedure through VB

3. HELP!!!!, using ADO + SQL 2000 + Stored procedures does not return a value

4. HELP!!!!, using ADO + SQL 2000 + Stored procedures does not return a value

5. Returning Values from SP with VB.NET

6. Returning values from SP with VB.NET

7. Getting the counter value after an addnew-SQL SERVER 2000/ADO

8. pass parameter to SQL SP from VB and return recordset

9. Testing Return Status of SQL SP using VB

10. Getting a return value from a stored procedure in SQL Server

11. SQL Server 2000, VB 6.0, ADO

12. seek in SQL server 2000 with VB 6.0

 

 
Powered by phpBB® Forum Software