Error trying to call stored procedure with prepared statement

You want something like this (untested) Dim cmd, rs, ars, conn Set cmd = Server.CreateObject(“ADODB.Command”) With cmd ‘Assuming passing connection string if passing ADODB.Connection object ‘make sure you use Set .ActiveConnection = conn also conn.Open should ‘have been already called. .ActiveConnection = conn ‘adCmdStoredProc is Constant value for 4 (include adovbs or ‘set typelib in … Read more

ADODB.Parameters error ‘800a0e7c’ Parameter object is improperly defined. Inconsistent or incomplete information was provided

Common occurrence is likely you do not have adVarChar defined, so the CreateParameter() method is “improperly defined”. This is just an example of one of the many named constants found in the ADODB Library. A messy approach to dealing with this is to just define the value yourself something like; Const adVarChar = 200 The … Read more

Accessing SQL Database in Excel-VBA

I’ve added the Initial Catalog to your connection string. I’ve also abandonded the ADODB.Command syntax in favor of simply creating my own SQL statement and open the recordset on that variable. Hope this helps. Sub GetDataFromADO() ‘Declare variables’ Set objMyConn = New ADODB.Connection Set objMyRecordset = New ADODB.Recordset Dim strSQL As String ‘Open Connection’ objMyConn.ConnectionString … Read more