HELP! CreatePreparedStatement and SQL Server 6.0 stored procedure 
Author Message
 HELP! CreatePreparedStatement and SQL Server 6.0 stored procedure

Hi all,

The following message is wordy and probably incoherent, but please bear
with me...

I am trying to execute a stored procedure on a SQL Server 6.0 database
from an OLE DLL.  I want to execute the sp_addlogin system-level stored
procedure, using question marks as parameter markers.  I am issuing the
following...

I have an object oAddUser As rdoPreparedStatement,
moConnection as rdoconnection
sStmt as string

sStmt = "{ ? = call sp_addlogin (?, ?, ?) }"

set oadduser = createpreparedstatement("SetLogin", sStmt)

Then I want to set the different parameters to their associated string
values (loginID, Password, default database).  I don't need to set the
direction property of the first parameter, because SQL server knows that
it is a return value (VB4.0 Enteprise online help - Direction property).

BUT...It seems that oadduser.rdoparameters.count = 0!  It should equal
4.  So when I try to set oadduser.rdoparameters(1) = sLogin, it craps
out and tells me "Invalid parameter passed."  It apparently does not
like me referencing collection item 1 when the count of collection items
is 0.

It seems as though the driver is not finding/translating the question
marks as parameter markers.

If I change the second parameter of the createpreparedstatement method
to be a SQL SELECT with a ? in the where clause, it tells me that the
count of parameters is 1, which is correct!  But I'm working with stored
procedures, so the SQL SELECT is useless!!

I'm logged into the SQL Server as SA, so I'm sure I have the rights to
be using sp_addlogin.

A Microsoft rep mentioned that SQL Server is very picky about the
cursordriver property of the rdoenvironment when working with
parameterized stored procedures.  Our cursordriver is set at Server-Side
cursors (2).

Any solutions or suggestions!

Thanks!!

Peace,
Gary



Sun, 06 Dec 1998 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. HELP! CreatePreparedStatement and SQL Server 6.0 stored procedure

2. VB4 RDO Won't detect an error in an SQL Server 6.0 stored procedure

3. executing stored procedures from VB3.0/SQL Server 6.0

4. MS SQL Server 6.0 stored procedures

5. MS Sql Server 6.0 Stored Procedures

6. HELP: Calling Stored Procedure w/large output from VB6 (using SQL Server)

7. Help! Stored procedure in SQL Server - VB4

8. Help with Stored Procedures using SQL Server and VB3.0

9. HELP: Calling Stored Procedure w/large output from VB6 (using SQL Server)

10. HELP - ASP Calling SQL Server Stored procedure

11. Need Help In SQL Server - Store Procedure

12. HELP: Calling Stored Procedure w/large output from VB6 (using SQL Server)

 

 
Powered by phpBB® Forum Software