sbensen Report post Posted 03/28/2005 09:47 PM I have an ODBC connection set up to point to an Access Database which I can connect to with a Query Database module. However, I want to execute an access query directly and my understanding is that I need to use a VBScript module to do it. I have a VBScript module set up with the following code but I keep getting a "Object Required" error message. 'ADProd' is my ODBC connection name and "TestInsertQuery" is my query name. What am I doing wrong? 'Declare Vars dim cmdCommand, prmParameter, rsRecordset, cnConnection, sParam 'Open Your Connection set cnConnection= "DSN=ADProd;" cnConnection.open 'Initialize Input Parameters sParam = "My Param" set cmdCommand= server.createobject("adodb.command") set prmParameter= server.createobject("adodb.parameter") set rsRecordset= server.createobject("adodb.recordset") With cmdCommand 'Prepare Command set .ActiveConnection = cnConnection .CommandType = adCmdStoredProc .CommandText = "TestInsertQuery" 'Parameter set prmPartyView = .CreateParameter("@SPParameter", adVarChar, _ adParamInput,255,sParam ) .Parameters.Append prmParameter 'Execute Stored Procedure and return Recordset if needed. set rsRecordset= cmdCommand.execute End With Share this post Link to post
SupportTeam Report post Posted 03/30/2005 12:59 AM I keep getting a "Object Required" error message. On which line does this error occur? Best to just get the VBScript working first (save it in a .VBS file and run it direct) and then when it's working then place it in the 'Run VBScript" module. Share this post Link to post