Database Connectivity

Discussion in 'ASP General' started by MROPARTNER@comcast.net, Dec 27, 2004.

  1. Guest

    Microsoft has a tutorial for ASP. There is a connection string in the
    code
    as follows:

    DBQ=C:\Inetpub\Wwwroot\Tutorial\guestbook.mdb;"\

    How do I change this statement once I move the page to my web server?
    I
    have the database in my root folder.


    Thanks
     
    , Dec 27, 2004
    #1
    1. Advertising

  2. Try using this, both locally and remotely:

    Dim sConnectionString
    sConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
    Server.MapPath("/tutorial/guestbook.mdb")

    Note that unless you've configured IIS so that read-access is denied to that
    file or directory via HTTP, anyone in the world can download your database.
    (Assuming that directory is a WWW-published directory.)

    Ray at work


    <> wrote in message
    news:...
    > Microsoft has a tutorial for ASP. There is a connection string in the
    > code
    > as follows:
    >
    > DBQ=C:\Inetpub\Wwwroot\Tutorial\guestbook.mdb;"\
    >
    > How do I change this statement once I move the page to my web server?
    > I
    > have the database in my root folder.
    >
    >
    > Thanks
    >
     
    Ray Costanzo [MVP], Dec 27, 2004
    #2
    1. Advertising

  3. Jeff Cochran Guest

    On Mon, 27 Dec 2004 16:11:54 -0500, "Ray Costanzo [MVP]" <my first
    name at lane 34 dot commercial> wrote:

    >Try using this, both locally and remotely:
    >
    >Dim sConnectionString
    >sConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
    >Server.MapPath("/tutorial/guestbook.mdb")


    As an explanation, Server.MapPath finds the actual physical path on
    the system to the file beginning at the root of the web. So if your
    file was physically at:

    c:\inetpub\wwwroot\subfolder1\application\database.mdb

    and your site's root was at:

    c:\inetpub\wwwroot\

    then the MapPath argument would be:

    ("/subfolder1/application/database.mdb")

    Using MapPath ensure that the structure of your web site is followed,
    no matter where the root of your site happens to be on the server.
    Your ISP could have your root at H:\Webroots\BasicHostingPlans\Bob\
    and as long as your structure of your site is the same as on your
    home/development system you don't need to change the code.

    Jeff


    >Note that unless you've configured IIS so that read-access is denied to that
    >file or directory via HTTP, anyone in the world can download your database.
    >(Assuming that directory is a WWW-published directory.)
    >
    >Ray at work
    >
    >
    ><> wrote in message
    >news:...
    >> Microsoft has a tutorial for ASP. There is a connection string in the
    >> code
    >> as follows:
    >>
    >> DBQ=C:\Inetpub\Wwwroot\Tutorial\guestbook.mdb;"\
    >>
    >> How do I change this statement once I move the page to my web server?
    >> I
    >> have the database in my root folder.
    >>
    >>
    >> Thanks
    >>

    >
     
    Jeff Cochran, Dec 27, 2004
    #3
  4. Guest

    Jeff,

    Do you offer consulting (tech support) by the hour? If so what is your
    fee?

    Thanks
     
    , Dec 28, 2004
    #4
  5. Jeff Cochran Guest

    On 27 Dec 2004 18:06:00 -0800, wrote:

    >Do you offer consulting (tech support) by the hour? If so what is your
    >fee?


    Contact me via email at:

    jeff at zina dot com

    Jeff
     
    Jeff Cochran, Dec 29, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. gpeacock

    ASP database connectivity KB253604

    gpeacock, Nov 5, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    350
    Michael Evanchik
    Nov 10, 2003
  2. Steven Caliendo

    MySQL database connectivity

    Steven Caliendo, Dec 17, 2003, in forum: ASP .Net
    Replies:
    6
    Views:
    447
    dryer
    Dec 18, 2003
  3. Niks

    Database Connectivity using DSN

    Niks, Dec 22, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    10,879
    Kevin Spencer
    Jan 12, 2004
  4. Arun K

    Database Connectivity using DSN

    Arun K, Dec 22, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    405
    Natty Gur
    Dec 23, 2003
  5. C Newby

    Database Connectivity Problem ...

    C Newby, Apr 16, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    319
    C Newby
    Apr 16, 2004
Loading...

Share This Page