Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2001-12-31 : 09:54:36
|
| Ujjal writes "How can I call a sql server stored procs from a VB. The stored procs does not return any record set. I have some select statement inside the stored procs. I want to show the records fetched by that select stmt inside vb code. How to do it?" |
|
|
Nazim
A custom title
1408 Posts |
Posted - 2001-12-31 : 10:31:19
|
| have a ADODB connectiondim conn as new ADODB.Connectiondim rs as new ADODB.Recordsetconn.open(connectionstring)set rs=conn.execute ("Exec stopredprocedure")should do it.HTHEdited by - Nazim on 12/31/2001 10:34:51 |
 |
|
|
Onamuji
Aged Yak Warrior
504 Posts |
Posted - 2001-12-31 : 14:29:49
|
quote: The stored procs does not return any record set. I want to show the records fetched by that select stmt ...
Other than your false statement above here's another way to execute a procedure. In ADO the connection object makes functions for each stored procedure in the database it connects to. Well it doesn't really make them it uses something called a Vtable lookup and such fun stuff but it works... oh the functions take all the parameters of the stored procedure and an optional last parameter that is the recordset to return the data in. Dim cn As ADODB.ConnectionDim rs As ADODB.RecordsetSet cn = New ADODB.Connectioncn.Open CONNECTION_STRINGcn.StoredProcedureName rs - Onamuji |
 |
|
|
Nazim
A custom title
1408 Posts |
Posted - 2001-12-31 : 14:56:01
|
| Happy New Year Every1 there,a small edition is required on my previous postdim conn as new ADODB.Connectiondim rs as new ADODB.Recordsetconn.open connectionstringset rs=conn.execute ("Exec stopredprocedure " & param1 &)Onamji, thanx i never realized that there was something specifically for storedprocedure in connection object. Does it Speeds up the performance or it is just for ease of use. |
 |
|
|
|
|
|