|
-
Nov 27th, 2013, 03:58 AM
#1
Thread Starter
Lively Member
getting records from storedprocedure in recordset in excel vba
Set cmd = New ADODB.Command
cmd.CommandType = adCmdStoredProc
Set cmd.ActiveConnection = Module1.conn
cmd.CommandText = "spEmergencyItemHelp"
Set prm = cmd.CreateParameter("@ID", adInteger, adParamInput, 255, 12)
cmd.Parameters.Append prm
Set prm = cmd.CreateParameter("@Type", adChar, adParamInput, 255, "A")
cmd.Parameters.Append prm
Set rst = cmd.Execute()
Do Until rst.EOF
Set Sheet1.VSFlexGrid1.DataSource = rst
rst.MoveNext
Loop
i am trying to execute a stored procedure from sql2005 from excel vba get the records in recordset & assign it to grid
but i get error
run time error 3709 application defined or object defined error
-
Nov 27th, 2013, 11:51 AM
#2
Re: getting records from storedprocedure in recordset in excel vba
What's the underlying value/code of Module1.conn?
I believe this is the connection string right?
KG
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|