ASP Beginner Connecting to an Access Database

Discussion in 'ASP General' started by Shaun, Jun 5, 2004.

  1. Shaun

    Shaun Guest

    Hi,

    I have recently been given an ASP site to administer, however I cannot get
    the site to connect to the access the Access database.

    This is the current connection file:

    <%
    ' FileName="Connection_ado_conn_string.htm"
    ' Type="ADO"
    ' DesigntimeType="ADO"
    ' HTTP="true"
    ' Catalog=""
    ' Schema=""
    'Dim MM_conn***_STRING
    'MM_conn***_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=***"
    'MM_conn***_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=***"
    Dim MM_conn***_STRING
    MM_conn***_STRING = "dsn=***;"
    %>

    How can I modify this file such that it connects to the database in the same
    directory as the file?

    Thanks for your help
     
    Shaun, Jun 5, 2004
    #1
    1. Advertising

  2. hi,

    sorry but i don't realy understand the code you post. Usualy, to connect to
    a database with an ODBC system connection we use this kind of code :
    <%
    set conn=Server.CreateObject("ADODB.Connection")
    conn.Open "MyODBCLabel"
    %>and this kind to connect with the file name :

    <%
    set conn=Server.CreateObject("ADODB.Connection")
    conn.Provider="Microsoft.Jet.OLEDB.4.0"
    conn.Open "d:\MyDB.mdb "
    %>


    "Shaun" <> a écrit dans le message de
    news:...
    > Hi,
    >
    > I have recently been given an ASP site to administer, however I cannot get
    > the site to connect to the access the Access database.
    >
    > This is the current connection file:
    >
    > <%
    > ' FileName="Connection_ado_conn_string.htm"
    > ' Type="ADO"
    > ' DesigntimeType="ADO"
    > ' HTTP="true"
    > ' Catalog=""
    > ' Schema=""
    > 'Dim MM_conn***_STRING
    > 'MM_conn***_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=***"
    > 'MM_conn***_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=***"
    > Dim MM_conn***_STRING
    > MM_conn***_STRING = "dsn=***;"
    > %>
    >
    > How can I modify this file such that it connects to the database in the

    same
    > directory as the file?
    >
    > Thanks for your help
    >
    >
     
    Martin CLAVREUIL, Jun 5, 2004
    #2
    1. Advertising

  3. Shaun

    Bob Lehmann Guest

    MM_maybe you stop using DreamWeaver and pick up a book on ASP. It MM_might
    help.


    Bob Lehmann

    "Shaun" <> wrote in message
    news:...
    > Hi,
    >
    > I have recently been given an ASP site to administer, however I cannot get
    > the site to connect to the access the Access database.
    >
    > This is the current connection file:
    >
    > <%
    > ' FileName="Connection_ado_conn_string.htm"
    > ' Type="ADO"
    > ' DesigntimeType="ADO"
    > ' HTTP="true"
    > ' Catalog=""
    > ' Schema=""
    > 'Dim MM_conn***_STRING
    > 'MM_conn***_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=***"
    > 'MM_conn***_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=***"
    > Dim MM_conn***_STRING
    > MM_conn***_STRING = "dsn=***;"
    > %>
    >
    > How can I modify this file such that it connects to the database in the

    same
    > directory as the file?
    >
    > Thanks for your help
    >
    >
     
    Bob Lehmann, Jun 6, 2004
    #3
  4. Shaun

    Jeff Cochran Guest

    On Sat, 5 Jun 2004 22:55:00 +0100, "Shaun" <> wrote:

    >Hi,
    >
    >I have recently been given an ASP site to administer, however I cannot get
    >the site to connect to the access the Access database.
    >
    >This is the current connection file:
    >
    ><%
    >' FileName="Connection_ado_conn_string.htm"
    >' Type="ADO"
    >' DesigntimeType="ADO"
    >' HTTP="true"
    >' Catalog=""
    >' Schema=""
    >'Dim MM_conn***_STRING
    >'MM_conn***_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=***"
    >'MM_conn***_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=***"
    >Dim MM_conn***_STRING
    >MM_conn***_STRING = "dsn=***;"
    >%>
    >
    >How can I modify this file such that it connects to the database in the same
    >directory as the file?


    You'll want to ask in a Macromedia/Dreamweaver group, since that's
    what produced the code. If you want an ADO connection string you can
    use in ASP, check:

    http://www.able-consulting.com/ADO_Conn.htm

    Jeff
     
    Jeff Cochran, Jun 6, 2004
    #4
    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. Tom Wild
    Replies:
    1
    Views:
    10,992
    Kevin Swarts
    Aug 25, 2003
  2. Bart Schelkens

    Connecting to an Access-database

    Bart Schelkens, Nov 19, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    436
    Bart Schelkens
    Nov 19, 2004
  3. Nathan Sokalski
    Replies:
    9
    Views:
    484
    Steve Long
    Jun 8, 2005
  4. ali
    Replies:
    2
    Views:
    394
  5. Krish
    Replies:
    3
    Views:
    647
    Phlip
    Oct 19, 2004
Loading...

Share This Page