Results 1 to 9 of 9
  1. #1
    New Lounger
    Join Date
    Aug 2002
    Location
    Tillicoultry, Clackmannanshire, Scotland
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Access 2000 and ASP (Access 2000 SR1)

    I am trying to publish database as ASP pages. I follow the procedure, Export as ASP, Point the ODBC driver at the database and publish the ASP page on the web server on my desktop (C:Inetpubwwwroot) When I load the ASP page in a browser all the column headings for the table are displayed but no data at all. Am I being a bit thick here or have I missed an important step. I have checked the web server and it is running.

    Help.
    Seoras

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Access 2000 and ASP (Access 2000 SR1)

    The fact that you get the column headings to appear suggests to me that you have set things up properly. I followed your steps and it worked OK.

    What data are you trying to publish? A table or a query? Is it possible that your query just does not return any records? Have you looked at the sql contained in the asp page then tested the same sql from within the database?
    Regards
    John



  3. #3
    New Lounger
    Join Date
    Aug 2002
    Location
    Tillicoultry, Clackmannanshire, Scotland
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access 2000 and ASP (Access 2000 SR1)

    I am using the Northwind database till I get this right. I exported the products table as an ASP page and when I load it into IE I get the table headings but no data below. The sql in the ASP page is below. I have no idea what's happened here.
    Seoras

    If IsObject(Session("Northwind_conn")) Then
    Set conn = Session("Northwind_conn")
    Else
    Set conn = Server.CreateObject("ADODB.Connection")
    conn.open "Northwind","",""
    Set Session("Northwind_conn") = conn
    End If
    %>
    <%
    If IsObject(Session("Products_rs")) Then
    Set rs = Session("Products_rs")
    Else
    sql = "SELECT * FROM [Products]"
    Set rs = Server.CreateObject("ADODB.Recordset")
    rs.Open sql, conn, 3, 3
    If rs.eof Then
    rs.AddNew
    End If
    Set Session("Products_rs") = rs
    End If

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Access 2000 and ASP (Access 2000 SR1)

    Why are you testing .EOF? That works with DAO recordsets but is unreliable with ADO recordsets, so I suspect you're getting no records because the code is falling into the .AddNew instruction. Try testing for rs.recordcount <> 0 instead and see what happens.
    Charlotte

  5. #5
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Access 2000 and ASP (Access 2000 SR1)

    Sorry, I don't know what to suggest.

    I can't recreate your problem.

    When you set up the ODBC stuff, what Category of DSN did you create the data source in: User, System or File?
    I am not sure which to use, but they all seem to work for me.
    Regards
    John



  6. #6
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Access 2000 and ASP (Access 2000 SR1)

    Charlotte

    The code is created automatically when you do the export.

    The EOF stuff is working for me, but the Products table has the field ProductName set as required, so the AddNew command must fail if it is called.
    Regards
    John



  7. #7
    New Lounger
    Join Date
    Aug 2002
    Location
    Tillicoultry, Clackmannanshire, Scotland
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access 2000 and ASP (Access 2000 SR1)

    This is the procedure I followed:
    1. Open the Northwind DB
    2. Select Products table and export as ASP
    3. save products.asp to C:Inetpubwwwroot
    4. Open ODBC data control panel
    5. Under System DSN tab Add new data source.
    6. select the Microsoft Access driver.
    7. select the Northwind database as the data source.
    8. Load products.asp into IE table is displayed with headings but no data in the columns.

    Seoras

  8. #8
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Access 2000 and ASP (Access 2000 SR1)

    Seoras

    I think I may know where the problem is - the last step.

    How do you "Load the Prducts.asp into IE".

    For ASP pages, you can't use File...Open.

    Instead you need to use http://localhost/products.asp

    You will probably also have a name for localhost that you can use instead. Open Personal Webserver and it will tell you what it is.

    When you use File...Open, the Web server is not used, so the asp code does not run.
    Regards
    John



  9. #9
    New Lounger
    Join Date
    Aug 2002
    Location
    Tillicoultry, Clackmannanshire, Scotland
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access 2000 and ASP (Access 2000 SR1)

    Fantastic, thanks John.
    I was in fact opening the file by right clicking and selecting open with IE which has the same effect as File/Open. I just typed http://localhost/products.asp into IE and up it popped.

    Thank you very much for your time on this.
    Regards
    Seoras

Posting Permissions

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