Troubles connecting to the db

Results 1 to 2 of 2

Thread: Troubles connecting to the db

  1. #1
    Join Date
    Dec 1969

    Default Troubles connecting to the db

    For the life of me I cannot figure out why I cannot connect to the DB. Any ideas are welcomed : )<BR><BR>Error Type:<BR>Microsoft VBScript runtime (0x800A01FB)<BR>An exception occurred: &#039;Root.Open&#039;<BR>/egov/test.asp, line 11<BR><BR>set conn=Server.CreateObject("ADODB.Connection")<BR>co nn.Provider="Microsoft.Jet.OLEDB.4.0"<BR>bob = Server.MapPath("databasedocument.mdb")<BR>conn.Ope n bob<BR><BR>mySQL = "Select * from Documents,document_type where Documents.ParentID = " & pID & " and documents.document_type = document_type.document_type_id and document_type.inMenu = True and active = 1 order by docRank,Title"<BR><BR>Set Root = Server.CreateObject("ADODB.RecordSet")<BR>***Line 11 *** Root.Open mySQL, conn, 1, 3,1<BR>While Not Root.EOF<BR> response.Write root("documentID")<BR> Root.MoveNext<BR>Wend<BR>Root.Close<BR>Set Root = Nothing

  2. #2
    Join Date
    Dec 1969

    Default Connecting?

    Looks to me like you are connecting with "conn.Open bob" just fine. Just in case, here is a proper OLEDB connection string for Access:<BR><BR><BR><BR>Are you sure there isn&#039;t something wrong with your query? You may want to test a simple query and make sure it works.<BR><BR>Also... Why aren&#039;t you using the proper ADO constants?<BR><BR>

Posting Permissions

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