SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    .net install meltdown
    Join Date
    May 2001
    Location
    View Ridge
    Posts
    692
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    An asp newbie question

    I've been reading K Yank's article on asp & MS Access.

    I keep getting this error:

    Microsoft VBScript runtime error '800a01b6'

    Object doesn't support this property or method: 'Open'

    /library_test.asp, line 18

    I've doubled checked the code and can't find any typos. I can't figure out what I'm doing wrong - I new to this.

    Code:
    <%
    Dim rsLibrary
    Dim strConn
    rsLibrary = Server.CreateObject("ADODB.Recordset")
    strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\library.mdb"
    rsLibrary.Open "lib", strConn
    
    Do While Not rsLibrary.EOF
      Response.Write "<p>" & rsLibrary("Title")
      Response.Write "</br>" &rsLibrary("Keyword") & "</p>"
      rsLibrary.MoveNext
    Loop
    If rsLibrary.BOF Then
      Response.Write "<p>No entries in the Library!</p>" & vbNewLine
    End If
    
    rsLibrary.Close
    %>
    What's wrong? I'm running PWS is that the problem?

    Argg!

  2. #2
    SitePoint Zealot
    Join Date
    Oct 2001
    Location
    Dallas/Ft. Worth
    Posts
    101
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    re:

    It's been a while since I've done ASP. But it looks to me that your ODBC configuration is not correct.

    or

    Try moving your db to the folder where your script is.

    or

    your 'rs.Open "lib" ConnStr' line, what is this "lib", it stands out akward? (I don't have installed VB any more so I cannot look up the syntax on 'Open' method, but make sure "lib" is the string that needs to be there.

    or

    Check your file that was created by ODBC in the directory where your database is (I think it has extension like .dsm or something similar and your db name or any name you gave it at ODBC set up)...make sure the settings are correct there.

    Good Luck!

  3. #3
    .net install meltdown
    Join Date
    May 2001
    Location
    View Ridge
    Posts
    692
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm at the copy-paste-test knowldge level now, but got it to work using ODBC. I think I was also having problems w/ Option Expilict & declaring variables.

    "lib" is the table name. Using "library" for the recordset & table where confusing when trying to understand the code.

    Guess I got a lot to learn.

    Thanks for the help.

  4. #4
    Say WHA?! goober's Avatar
    Join Date
    Sep 2000
    Location
    United States
    Posts
    1,921
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    We all have a lot to learn constantly. Don't worry about it.
    Sean Killeen [LinkedIn] [Twitter] [Web]

    Warning: Reality.sys corrupted. Universe halted. Reboot? (Y/N)

  5. #5
    SitePoint Zealot
    Join Date
    Oct 2001
    Location
    Dallas/Ft. Worth
    Posts
    101
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    re:

    Perhaps you should look at different tutorials beside the one you're looking - "Not all men are created equal" and it works the same for tutorials. If you're serious, by a book as well, and I suggest any book published by Wrox.

    Good Luck!

    p.s. I looked at my old code and I implemented database connection using .dsn file (which gets created when you set up ODBC connection) I was telling you about.


Bookmarks

Posting Permissions

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