help ASP Database !!

Results 1 to 2 of 2

Thread: help ASP Database !!

  1. #1
    Join Date
    Dec 1969

    Default help ASP Database !!

    hi, <BR>I already registered on, and I want to test my database using ASP on that server.<BR>I create a guest book but I am storing the information in a database.<BR>My questions :<BR>1. in Teach yourself ASP 3.0 21 days chap 15, I must have <BR> objconn.ConnectionString=Driver={blabla }&_"dbq=C:labla.mdb"<BR>I test it and it works.My problem is When I put all the database in and it seems I have already tried to eliminate<BR>the directory so it will like this <BR>"dbq=friends.mdb" but it did not work. Is there any way to call <BR>my database automatically without put any directory and drive ,because in the server I can&#039;t create any drive and directory.<BR>2 second problem<BR>in chapter 16 and chapter 17, you always use "DatabaseConnect.Asp" that means you are using DSN every time you want to connect to database or want to do insert,delete,update or anything with database.<BR>My question is how can I detect on which dsn they are using ?<BR>So I can exactly insert,delete,update in their servers without known anything about dsn, the connection type.<BR><BR>Thanks in advance<BR>regards,<BR>hendri<BR><BR><BR><BR> <BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: help ASP Database !!

    To answer question 2 first: You can NOT use a DSN on, according to what I have heard. You might be able to if you pay for the usage, but not with the free sites.<BR><BR>Question 1, then:<BR><BR>You need to change from:<BR>objconn.ConnectionString=Driver={blabla }&_<BR>&nbsp; &nbsp; "dbq=C:labla.mdb"<BR><BR>to:<BR>objconn.Connectio nString=Driver={blabla }&_<BR>&nbsp; &nbsp; "dbq=" & Server.MapPath("blabla.mdb")<BR><BR>Look into the docs for Server.MapPath. The path and file you give to Server.MapPath is *relative* to the directory where the ASP page is running (in the code above, it would be in the same directory) unless you start the path with a "/", in which case the path and file are relative to your virtual directory.<BR><BR>SO:<BR><BR>objconn.ConnectionStr ing=Driver={blabla }&_<BR>&nbsp; &nbsp; "dbq=" & Server.MapPath("/data/blabla.mdb")<BR><BR>would use the "data" directory that is directly under the root directory of your virtual directory. <BR><BR>Etc., etc., etc.<BR><BR><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