Newcomer. Access database connection dilemma!!!

Results 1 to 4 of 4

Thread: Newcomer. Access database connection dilemma!!!

  1. #1
    Nik Nikam Guest

    Default Newcomer. Access database connection dilemma!!!

    I have PWSand I use FP2000 to create webpasges.<BR>I&#039m trying to open it using a DSNless appraoch.<BR><BR>&#060;%@Language="VBScript"%&#062 ;<BR>&#060;!--#INCLUDE FILE="adovbs.asp" --&#062;<BR>&#060;%<BR>&#039Declare all local variables<BR><BR>dim conn<BR>dim rs<BR>dim strID<BR>dim strconn<BR>dbfile="diag.mdb"<BR>strconn="DRIVER={M icrosoft Access Driver(*.mdb)};" & "DBQ=" & Server.MapPath(dbfile)<BR><BR>set conn = Server.CreateObject("ADODB.connection")<BR>conn.op en strconn<BR><BR>set rs = server.createobject("adodb.recordset")<BR>rs.Open "DIAGNOSIS", conn,adopenstatic, adlockoptimistic ...<BR><BR>However I keep geeting this error:<BR><BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80004005&#039 <BR><BR>[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified <BR><BR>/cardiology/uddiag.asp, line 26 <BR><BR>I&#039m using FP2000. I don&#039t know why I get this error. I&#039ve read several books and looked at many on-line examples. But, I can&#039t get my code to open the DB file for display or update. I&#039ve even set the DSN using the OBDC from the control pannel. The PWS option is set to execute.<BR><BR>Please shed some light and direction.<BR>

  2. #2
    Richard L. Guest

    Default RE: Newcomer. Access database connection dilemma!!

    Is your .mdb file actually in the same path as Server.MapPath Use response.write to output Server.MapPath(dbfile) and check where ASP thinks it&#039s looking for this file.

  3. #3
    Nik Nikam, Guest

    Default RE: Little progress. Access database connection di

    Richard:<BR>Thanks for your help<BR>Here is the answer when I used response.write<BR><BR>C:Inetpub
    ikfpdbdiag.dbm <BR><BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80004005&#039 <BR><BR>[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified <BR><BR>/cardiology/uddiag.asp, line 27 <BR>______________________________________________ _____________<BR><BR>The actual path on the local drive using PWS is:<BR>c:websharewebrootcardiofpdbdaig.mdb<BR>the vitual pathname is: cardiology="c:webhsarewebrootcardio" in PWS (personal web server)<BR>q1: How do I get it to point to the right directory?<BR>q2: What code do I need to write when I upload this page (uddiag.asp)to my web host site. Do I need to make any changes. Again, thanks for your response.

  4. #4
    Richard L. Guest

    Default RE: Little progress. Access database connection di

    Okay.. here&#039s what you do. Create a new virtual directory with some appropriate name (like &#039data&#039) and point it do the directory where your *.mdb file is. How you do this depends on which version of PWS you have (what options do you see when you rt-click on the PWS icon in the system tray?)<BR><BR>Then use Server.MapPath("/yourName"). This will map the path of that virtual dir to it&#039s real dir on your machine.<BR><BR>Voila!<BR>Richard<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
  •