How to open a database connection

Discussion in 'Databases' started by alexf40, May 9, 2012.

  1. Hiya, it looks like the problem I've been having is because the connection to my database isn't open.

    Code:
    ADODB.Recordset error '800a0e7d'
    
    The connection cannot be used to perform this operation. It is either closed or invalid in this context.
    
    /test/DiveLocker.lib, line 16 

    This is the connection code I'm using, I'm assuming 'objConn.Open' should be after the ConnectionString, but then I get another error, below.

    Code:
    <%
    Dim objConn
    dim strDB
    
    Set objConn = Server.CreateObject("ADODB.Connection")
    UID=DB_41492_org4me_user; PWD=sxdSXD123; DATABASE=DB_41492_org4me; SERVER=(local)"
    
    objConn.ConnectionString = "Data Source=tcp:s07.Winhost.com;Initial Catalog=DB_41492_org4me;User ID=DB_41492_org4me_user;Password=sxdSXD123;Integrated Security=False;"
    
    %>



    Code:
    Microsoft OLE DB Service Components error '80040e21'
    
    Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
    Thanks Alex
     
    Last edited by a moderator: Oct 14, 2015
  2. Fixed. I didn't need tcp.
     
  3. Glad you worked it out!
     

Share This Page