Results 1 to 2 of 2

Thread: JScript: ActiveXObject("ADODB.Connection") - Help Please

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2001
    Location
    UK
    Posts
    205

    JScript: ActiveXObject("ADODB.Connection") - Help Please

    I am trying to connect to a server but i keep getting exception errors at the certain point in my routine. I have arrowed where the error occurs.

    Code:
    function dbConnect(sDBDriver, sDBServer, sUID, SPWD, sDBName) {
      var sConX;
      var sException;
      
      sConX = "DRIVER=" + sDBDriver + ";SERVER=" + sDBServer + ";UID=" + sUID + ";PWD=" + sPWD + ";DBNAME=" + sDBName + ";"  
    
      try {
        window.status = "Creating object";
        oDBConn = new ActiveXObject("ADODB.Connection");
      } catch(sException) {
        window.status = "Exception: Error creating object - " + sException;
        return(false);
      }
      
      try {
        window.status = "Connecting..."
    >>>>  oDBConn.Open(sConX);  <<<<
      } catch(sException) {
        // Exception error caught
        window.status = "Exception: Error connecting to server - " + sException;
        return(false);
      }
      
      return(true);  // Success connecting to server.  
    }
    I have tried other methods but none seem to work for me. The error is an Object Error.

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    You'll probably get a better response in the proper forum.

    http://www.vbforums.com/forumdisplay.php?s=&forumid=11
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

Posting Permissions

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



Click Here to Expand Forum to Full Width