I want to get the result from the stored procedure sp_who (on a SQL server) into my VB code.
sp_who shows an table so it would be nice to get the result in an adodc recordset.
I have tried the following code but it dosn't work. Any idea why?
/Regards LeChuck
Dim cnn1 As ADODB.Connection
Dim cmd As ADODB.Command
Dim rst As ADODB.Recordset
Dim strCnn As String
Set cnn1 = New ADODB.Connection
strCnn = "Provider=SQLOLEDB.1;Password=;Persist Security Info=False;User ID=sa;Initial Catalog=MyDB;Data Source=(local)
cnn1.Open strCnn
Set cmd = New ADODB.Command
Set cmd.ActiveConnection = cnn1
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.