Closing connection generates error

Results 1 to 5 of 5

Thread: Closing connection generates error

  1. #1
    Frank Cavalier Guest

    Default Closing connection generates error

    (Starting a new thread because of a likely burial of my earlier one.)<BR><BR>I had an earlier problem ("Too many client tasks.") that turned out to be an NT server collapse issue. The provider resolved that.<BR><BR>But in reference to suggestions made about closing recordsets and connections and setting them to nothing...<BR><BR>Well, that was my original intent, having used that in my VB coding, until I found that it generated this error:<BR>Microsoft VBScript runtime error &#039 800a01a8&#039 <BR><BR>Object required: &#039DRIVER={Microsoft Ac&#039 <BR><BR>(The strConn object was created with Set strConn = yadayadayada...)<BR><BR>This was my code. (Context was just after filling a 2-column table - right after &#060;/table&#062; and just before &#060;/body&#062;:<BR>&#060;%<BR>objRecordset.Close<BR>Se t objRecordset = Nothing<BR>strConn.Close<BR>Set strConn = Nothing<BR>%&#062;<BR>The error above points to the strConn.Close line...<BR><BR>What&#039s wrong with the code that it generates this error? You can see it at www.rjfa.org. Select "Current Rosters" from the menu, then select "Clinic Football". The error appears at the bottom of the list. It does not appear on the other lists (which close the recordsets and set them to nothing, but do not perform that with the connections, because the error is generated.) These are DSN-less connections if that makes a difference.<BR><BR>Am I overlooking something obvious?<BR><BR>Thanks for any insights,<BR><BR>Frank<BR><BR>

  2. #2
    Join Date
    Dec 1969
    Posts
    19

    Default RE: Closing connection generates error

    Hello, i&#039m Leonardo from Argentina.<BR><BR>I think that your problem is that you are trying to close strConn<BR>but this is not the connection object, it is the connection string.<BR><BR>Bye bye.

  3. #3
    Frank Cavalier Guest

    Default RE: Closing connection generates error

    Is there no connection object then when a DSN-less connection is made? I see what you mean, but there does not seem to be any reference to connection object in the code. Is that the case with DSN-less scenarios?<BR><BR>FC

  4. #4
    Join Date
    Dec 1969
    Posts
    168

    Default RE: Closing connection generates error

    Set cnn = Server.CreateObject("ADODB.Connection")<BR>cnn.Ope n DB_CONN_STRING<BR>^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^<BR>Look for lines smiliar to the ones above, this<BR>is the connection you need to close.<BR><BR>In this example, the way to close the db connection is as follows:<BR><BR>cnn.Close<BR>Set cnn = Nothing<BR><BR>Hope this helps...Cheers!


  5. #5
    Join Date
    Dec 1969
    Posts
    19

    Default RE: Closing connection generates error

    A DSN-less connection is still a connection object but does not connect to the data source through ODBC, it uses an OLEDB provider, for example:<BR><BR>Set Conn = Server.CreateObject("ADODB.Connection")<BR>Session ("Connection") = "Provider=MSDAORA.1;Password="&Request("p_password ")&";User ID="&Request("p_username")&";Data Source=grendel;Persist Security Info=False"<BR>Conn.ConnectionTimeout = 20<BR>Conn.Open Session("Connection")<BR><BR>Bye.

Posting Permissions

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