Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2014
    Posts
    1

    Unanswered: Database Connection Issues[NEWBIE]

    Okay so I just recently landed an internship. I am working on some code to link my database onto the IIS server. Right now I am running a windows 8 with IIS. I have created nothing extra other than a database through microsoft access 2010. I type up some really basic code but I am soo new to coding that I'm lost right now. I have gotten a few different errors. My initial error was on line 12:
    Code:
     Connect.Open "DSN=Database"
    This error message I don't see anymore because it generated ANOTHER error message which is as follows:
    Microsoft VBScript runtime error '800a01a8'

    Object required: ''

    /database.asp, line 14

    Here is a look at the code:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>JNET Database Connectiont</title>
    </head>
    
    <body>
    <% 
    Dim Connect, selectSQL, RecSet
    Set Connect = CreateObject ("ADODB.Connection")
    Connect.Open "DSN=Database"
    selectSQL = "SELECT * FROM hardware"
    Set RecSet = mConnect.Execute ("selectSQL")
    If NOT RecSet.EOF THEN
    DO UNTIL RecSet.EOF
    Response.Write RecSet("Companyname") & ", " & RecSet("Contactname") & "<BR><BR>"
    RecSet.MoveNext
    Loop
    End If
    RecSet.Close
    Connect.Close
    Set RecSet = Nothing
    Set Connect = Nothing
    %>
    </body>
    </html>
    I have created a microsoft data link file so that I could configure setting for the database there. I also created a DSN connection for my database under data sources. My database file is named "Database". I am not sure what to do and if anyone could point me in the right direction so I can learn that would be greatly appreciated.

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    I think your connections string is wrong. See here for the different options: http://www.connectionstrings.com/access/
    George
    Home | Blog

Posting Permissions

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