Passing parameters from Excel to SQL 6.5 stored procedures 
Author Message
 Passing parameters from Excel to SQL 6.5 stored procedures

Hi,

I am trying to pass paramaters from an excel 97 spreadsheet into a
stored procedure in SQL Server 6.5.

I have tried some code samples from the MSDN but I have had no luck.
Part of the problem is that I do not have access to the ADO library.

Any suggestions, tips, references or samples would be very welcome.

Thanks in advance for your help.

Egie



Sat, 15 May 2004 23:09:00 GMT  
 Passing parameters from Excel to SQL 6.5 stored procedures

Quote:
>Hi,

>I am trying to pass paramaters from an excel 97 spreadsheet into a
>stored procedure in SQL Server 6.5.

>I have tried some code samples from the MSDN but I have had no luck.
>Part of the problem is that I do not have access to the ADO library.

>Any suggestions, tips, references or samples would be very welcome.

>Thanks in advance for your help.

>Egie

Is there any reason you can not download the ADO library? Thats the
best way.

Failing that

EXEC spWhatEver para1, para2



Sat, 15 May 2004 23:33:34 GMT  
 Passing parameters from Excel to SQL 6.5 stored procedures

Quote:


> >Hi,

> >I am trying to pass paramaters from an excel 97 spreadsheet into a
> >stored procedure in SQL Server 6.5.

> >I have tried some code samples from the MSDN but I have had no luck.
> >Part of the problem is that I do not have access to the ADO library.

> >Any suggestions, tips, references or samples would be very welcome.

> >Thanks in advance for your help.

> >Egie

> Is there any reason you can not download the ADO library? Thats the
> best way.

> Failing that

> EXEC spWhatEver para1, para2

Thanks for the tip Pete.

I have referenced Active X DAO 2.5 library and XLODBC.XLA in my
project so I can now use the ADODB functions.
The problem seems to be that my the stored procedure I am calling has
1200 characters. I used the following code but once I add any more
characters to the string, the procedure call does not get to SQL
Server

Sub RetrieveData()

   Dim Chan As Variant
   Dim insertContWork

   Chan = SQLOpen("DSN=EDAS17")


2,


'',

   = 'STRD',"

    SQLExecQuery Chan, _
    "InsertContWork " & insertContWork

     SQLClose (Chan)
End Sub



Sun, 16 May 2004 03:32:52 GMT  
 Passing parameters from Excel to SQL 6.5 stored procedures

Quote:
>I have referenced Active X DAO 2.5 library and XLODBC.XLA in my
>project so I can now use the ADODB functions.
>The problem seems to be that my the stored procedure I am calling has
>1200 characters. I used the following code but once I add any more
>characters to the string, the procedure call does not get to SQL
>Server

>Sub RetrieveData()

>   Dim Chan As Variant
>   Dim insertContWork

>   Chan = SQLOpen("DSN=EDAS17")


>2,


>'',


>   = 'STRD',"

>    SQLExecQuery Chan, _
>    "InsertContWork " & insertContWork

>     SQLClose (Chan)
>End Sub

Switch to ADO, no problems with field lengths then.

Look in the ADO help for "CreateParameter" and follow the VB example,
it will work with no problems in VBA.

HTH

Pete



Mon, 17 May 2004 16:02:53 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Passing parameters from Excel to SQL 6.5 stored procedures

2. SQL 6.5 stored procedure - parameter not returning

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

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

5. Stored Procedures with VB5/SQL Server 6.5

6. Accessing SQL 6.5 Stored procedures thru VB4.0

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

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

9. executing SQL Server 6.5 stored procedure using VB 5

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

11. ADO and SQL 6.5 sp_droplogin Stored procedure

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

 

 
Powered by phpBB® Forum Software