Dsn less connections and the command object

Results 1 to 2 of 2

Thread: Dsn less connections and the command object

  1. #1
    Join Date
    Dec 1969

    Default Dsn less connections and the command object

    I was connected to my db via a system dsn and everything was working ok but then i needed to change it to a non-dsn connection. <BR><BR>As a result i am having problems with the following code. I don&#039;t get any error messages but rsErrorInfo doesn&#039;t contain any records. <BR><BR><BR>objComm.ActiveConnection = cnnDatabase<BR>objComm.CommandText ="stpError"<BR>objComm.CommandType= adCmdStoredProc<BR><BR>set objParam = objComm.CreateParameter("RequiredCode", adVarChar, adParamInput, 50) <BR>set objParamComponent = objComm.CreateParameter("Component", adVarChar, adParamInput, 50) <BR><BR>objComm.Parameters.Append objParam <BR>objComm.Parameters.Append objParamComponent <BR><BR>objComm.Parameters("RequiredCode") = Session("ErrorCode") <BR>objComm.Parameters("Component") = Session("Component") <BR><BR>set rsErrorInfo =Server.CreateObject("ADODB.Recordset") <BR>Response.write objComm.Parameters("Component") <BR>Response.write objComm.Parameters("RequiredCode") <BR>rsErrorInfo.Open objComm, , adOpenStatic,adLockOptimistic <BR><BR>stpError is an access stored procedure/query which accepts two parametres errorcode and component..<BR><BR>my new connection is connecting to the db and i don&#039;t have any problems with my other recordsets (which don&#039;t use the command object)...<BR><BR>can anyone throw some light on this, <BR>thank you, <BR>una

  2. #2
    Join Date
    Dec 1969

    Default RE: Dsn less connections and the command object

    This is a crosspost from the Q&A, but as I don&#039;t know the answer, and you did leave it for a while, I&#039;ll not shout - just bear it in mind.<BR><BR>I don&#039;t KNOW the answer, but my guess is probably that you&#039;re now using the OLEDB provider to talk to the database, yeah?<BR><BR>My guess is that Access doesn&#039;t support this method of accessing a query natively. When you did it through the ODBC driver, it was being converted to a method it does support before it reached Access. ODBC does this a lot - it will escape some possible reserved word column names, things like that. Unfortunately, it&#039;s also dog-slow (probably because of those things), so I don&#039;t recommend switching back...<BR><BR>Why not just execute the query directly from ASP? I&#039;d be surprised if Access actually compiles the execution plan for a "query" in the same way SQL Server does with stored procedures, so you&#039;re probably not gaining any performance doing it this way...<BR><BR>Craig.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts