sending parameters from VB 6 to SQL 6.5 stored procedure 
Author Message
 sending parameters from VB 6 to SQL 6.5 stored procedure

I'm trying to send parameters from a VB 6 code to a SQL server 6.5
stored procedure.
sp simply retrieves a list of rows.

here it is:

Begin

')')
end
return

Now, this works fine when I call the procedure in SQL Query Tool as:
exec Vendors_Fetch "2653,3733"

In VB side, I created a dataenvironment and dragged the sp into it.
Code that's supposed to retrieve some rows is this:

temp = "2653,3733"
de1.Vendors_Fetch (temp)

I always get only the first row but not the other(s) i.e. row with key
value = 2653
In other words (de1.rsVendors_Fetch.recordcount) is equal to 1.
In other case where variable (Vendor_ID) is  a character but not an
integer, I call the procedure in SQL Query Tool as:
exec Vendors_Fetch "'2653','3733'"
and this works fine.

Back to VB application:

temp = "'2653','3733'"
de1.Vendors_Fetch (temp)
this time no rows retrieved not even the first row.

Anyone has any idea what's going on here???

Thanks,
Murat



Tue, 05 Jun 2001 03:00:00 GMT  
 sending parameters from VB 6 to SQL 6.5 stored procedure
Quote:

> I'm trying to send parameters from a VB 6 code to a SQL server 6.5
> stored procedure.
> sp simply retrieves a list of rows.

> here it is:

> Begin

> ')')
> end
> return

> Now, this works fine when I call the procedure in SQL Query Tool as:
> exec Vendors_Fetch "2653,3733"

> In VB side, I created a dataenvironment and dragged the sp into it.
> Code that's supposed to retrieve some rows is this:

> temp = "2653,3733"
> de1.Vendors_Fetch (temp)

> I always get only the first row but not the other(s) i.e. row with key
> value = 2653
> In other words (de1.rsVendors_Fetch.recordcount) is equal to 1.
> In other case where variable (Vendor_ID) is  a character but not an
> integer, I call the procedure in SQL Query Tool as:
> exec Vendors_Fetch "'2653','3733'"
> and this works fine.

> Back to VB application:

> temp = "'2653','3733'"
> de1.Vendors_Fetch (temp)
> this time no rows retrieved not even the first row.

> Anyone has any idea what's going on here???

> Thanks,
> Murat

Hi,

Dim Cmd as ADODB.Command, Rec as ADODB.Recordset
Set Cmd.ActiveConnection = <established adodb connection>
Cmd.CommandType = adCmdStoredProc
Cmd.CommandText = "Vendors_Fetch"

value to feed to stored Proc.
Set Rec = cmd.Execute

PS: after the cmd has executed use the debug window to check out the
cmd.Parameters.count and the associated values to look at the RETURN
value that SQL Server automatically generates (OR You can use in the
stored procedure to report your own flag conditions)

Merry Christmas

Trevor



Fri, 08 Jun 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. sending parameters from VB 6 to SQL 6.5 stored procedure

2. Passing parameters from Excel to SQL 6.5 stored procedures

3. SQL 6.5 stored procedure - parameter not returning

4. Passing parameters from Excel to SQL 6.5 stored procedures

5. executing SQL Server 6.5 stored procedure using VB 5

6. S10008 Error From SQL Server 6.5 Running VB 5.0 Stored Procedures

7. VB 5.0 & Stored Procedure (SQL Server 6.5)

8. S10008 Error From SQL Server 6.5 Running VB 5.0 Stored Procedures

9. S10008 Error From SQL Server 6.5 Running VB 5.0 Stored Procedures

10. Stored Procedures with VB5/SQL Server 6.5

11. Accessing SQL 6.5 Stored procedures thru VB4.0

12. Return value from stored procedure in SQL 6.5 to VB4 to a 16 bits client

 

 
Powered by phpBB® Forum Software