Connecting to DB

Results 1 to 10 of 10

Thread: Connecting to DB

  1. #1
    Jason Clouston Guest

    Default Connecting to DB

    Hello all.<BR>I&#039ve had a good read of similiar probs on these forums and so hope I have included all the relevant information:<BR><BR>Getting the old "http 500" error.. Here is the detailed error message:<BR><BR>&#060;!--- ERROR MESSAGE ---&#062;<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>/system_design/system_design_step1_results.asp, line 5<BR>&#060;!--- ERROR MESSAGE ---&#062;<BR><BR>And here is the ASP code:<BR><BR>&#060;!--- ASP CODE ---&#062;<BR>&#060;%<BR>Dim objConn<BR>Set objConn = Server.CreateObject("ADODB.Connection")<BR>objConn .ConnectionString = "DBQ=../fpdb/products.mdb;DRIVER={MS Access (*.mdb)}"<BR>objConn.Open<BR>%&#062;<BR>&#060;!--- ASP CODE ---&#062;<BR><BR>Sorry to bring up an obviously popular problem, but couldn&#039t find answer to mine!! If you have any ideas, please post!<BR>:)<BR>Jason<BR>

  2. #2 Guest

    Default Need to use Server.MapPath method

    objConn.ConnectionString = "DBQ=../fpdb/products.mdb;DRIVER={MS Access (*.mdb)}"<BR><BR>should read:<BR><BR>objConn.ConnectionString = "DBQ=" & server.mappath("../fpdb/products.mdb") & ";DRIVER={MS Access (*.mdb)}"<BR><BR>Your "../fpdb/products.mdb" is a virtual path (URL), but ADO works on physical path (Filesystem). The mappath method resolves the virtual path to the actual filesystem path.

  3. #3
    Linda Pyrc Guest

    Default RE: Connecting to DB

    Try this.<BR><BR>DB_DSN = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=../fpdb/products.mdb;" <BR><BR>Set DBConn = Server.CreateObject("ADODB.Connection")<BR>DBConn. Open DB_DSN<BR><BR>

  4. #4
    Jason Clouston Guest

    Default THANKS BOTH

    Cheers for your quick reply.<BR>Giving them both a go right now<BR>:)<BR>Jase

  5. #5
    Jason Clouston Guest

    Default No joy :(

    Tried both, didn&#039t work. Rang my ISP, they checked permissions and stuff and said everything was ok. They suggested that this sounded like it was trying to set up a DSN connection, not a DSN-less one? I am new to this ball park, so am feeling very inadequate, but need to do it this way so any help is much appreciated.<BR>:)<BR>Jase

  6. #6 Guest

    Default Your isp is wrong!

    I don&#039t know how they could say that. Just looking at your code, I can see that it is DSN-less. <BR><BR>Anyway if you tried my method and it did not work try this:<BR><BR>objConn.Open = "Provider=Microsoft.Jet.OLEDB.3.51; Data Source=" & server.mappath("../fpdb/products.mdb") & ";" <BR><BR>If you are using Access 2000 make change the ".3.51" to ".4.0".<BR><BR><BR>This is the method that I use and it works as long as I don&#039t do something stupid. Check that the relative path you have specified for your DB. What you have used indicates that the db is located by going down one folder towards the root and then going to the "fpdb" folder. Therfore the db folder is at the same folder level as where your code is, but in another branch. Is that correct?<BR><BR>

  7. #7
    Join Date
    Dec 1969

    Default Who is your ISP?

    If it is HalfPriceHosting, they don&#039t really understand ASP and databases. Almost always a permissions problem on the folder. <BR><BR>If it isn&#039t HPH, I&#039d still bet that the staff don&#039t know much of anything. (Witness that they thought you were trying to use a DSN. Dorks.) Keep pushing back; they&#039ll help you solve it.<BR><BR>You are,incidentally, using *exactly* what I use to do DSN-less on HPH...after yelling at them to get permissions to work for me.<BR>((You can see what I mean in most of the demos at )<BR><BR><BR>

  8. #8
    Jason Clouston Guest

    Default RE: Your isp is wrong!

    Cheers for reply,<BR>Trying your suggestions now....<BR>You got my folder tree correct too.<BR>:)<BR>Jase

  9. #9
    Jason Clouston Guest

    Default RE: Who is your ISP?

    My ISP are ZEN internet. Have been very happy with their technical expertise before, so will hassle them nicely!! <BR><BR>I like the link - some nice material and I really like your logo.<BR><BR>Thanks for your motivation to give my ISP a spanking - off to do it now<BR>:)<BR>Jase

  10. #10
    Jason Clouston Guest

    Default SUCCESS!!!

    Lo all,<BR>Got it all working :)<BR> <BR>the fix that did it was putting in the jet drivers.<BR>Thanks to all for your help, much appreciated :)<BR><BR>One very happy Jase

Posting Permissions

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