ASP database connection

Results 1 to 3 of 3

Thread: ASP database connection

  1. #1
    Join Date
    Dec 1969

    Default ASP database connection

    I&#039m doing something wrong with getting a DB connection.<BR>I want to simply connect an Acces database. Therefore, I have<BR>already read many tutorials and many code examples. <BR><BR>I&#039m using a server that is not my own, but I have full access<BR>to its wwwroot directory. <BR><BR>I&#039m using this asp code:<BR><BR>DIM Con<BR><BR>SUB readyDBCon<BR> IF Con = "" THEN<BR> Set Con = Server.CreateObject( "adodb.Connection" )<BR> con.Open "DBQ=" & Server.Mappath("discuss.mdb") & <BR> ";Driver=={Microsoft Access Driver (*.mdb)};"<BR> END IF<BR>END SUB<BR><BR>This piece of code is copied from superexperts page. It&#039s <BR>part of the discussion forum example.<BR><BR>My problem is the following error message:<BR><BR>[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified <BR><BR>Apparently it cannot find my MDB Access file. WHY NOT?<BR>Where do I have to put it and how do I link to it? I tries<BR>a (file)DNS, but that also results in the same error.<BR>I also tries the next code:<BR><BR>dbPath = "discuss.mdb"<BR>Con.Open "PROVIDER=MICROSOFT.JET.OLEDB.3.0;DATA SOURCE=" & dbPath<BR><BR>Still the same error. <BR>The situation is, that all asp code + the mdb file are in a subdirectory under the wwwroot directory: wwwrootTest<BR>I also tried dbPath = "Test/discuss.mbd" but to no avail.<BR><BR>ANY suggestions are welcome! I am an experienced programmer, but I just can&#039t figure this out.<BR><BR>Pat -&#062; for personal flames.

  2. #2
    steve balmer Guest

    Default RE: ASP database connection

    use the example that says oledb, but put a ";" at the end...

  3. #3
    Join Date
    Dec 1969

    Default RE: ASP database connection

    &nbsp;<BR>SideTrack::::Are you Steve Ballmer in the person of Microsoft new CEO? just curious.....:)-

Posting Permissions

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