Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004

    Unanswered: How to connect to an MS Access Database

    For starters, I have no scripting knoledge but I am trying to learn ASP. I have about a 2 hour train ride each day to do so (without Internet connection), and in order to work on a laptop with XP Pro, I have setup IIS and am using a MS Access database.

    I have setup a Filedsn as an example I found on the web stated I should, but this doesnt seem to be connecting to the database as I cannot get the info to print to screen. I am wondering if I should use a system dsn. If so what is the code required to do this? Any good websites that have lists of code and what it does? Im really a beginner but am very willing to learn. Any good books or tips?

    I made a basic database of movies that I own and thought I would pratice on that . I got everything to work fine from a SQL database (at work on a server) but I cannot get it to work with an MS Access database (I belive I am having problems connecting to the database)

    database "movies.mdb" location is c:\databases
    it has two feilds. Movies being the title and format being "w" for widescreen or "s" for standard

    when I run (test.asp being made in Dreamweaver MX and residing in the c:\inetpub\wwwroot\) I get

    Error Type:
    ADODB.Recordset (0x800A0BB9)
    Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
    /test.asp, line 17

    5 <%
    6 Set MyConn = Server.CreateObject("adodb.connection")
    7 MyConn = "FILEDSN=c:\dsn\MyTable_dsn.dsn"
    8 %>
    11 <%
    12 Set RS = server.createObject("ADODB.Recordset")
    15 SQL="Select * From movie order by movie"
    17 RS.OPEN SQL, Con
    20 %>
    21 <%=RS("movie")%> <br>

    I know I havent created the if then wend statement to keep it looping, but I should get it to print something even without it which brings me to thinking I havent connected to the database at all.

    Any help is appreciated.


  2. #2
    Join Date
    Jan 2004

Posting Permissions

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