• Access 2000 and ASP (Access 2000 SR1)

    Author
    Topic
    #404122

    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

    Viewing 0 reply threads
    Author
    Replies
    • #820055

      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?

      • #820227

        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

        • #820304

          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.

          • #820338

            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.

          • #820339

            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.

        • #820305

          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.

        • #820306

          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.

          • #820350

            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

            • #820604

              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.

            • #820690

              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

            • #820691

              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

            • #820605

              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.

          • #820351

            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

        • #820307

          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.

      • #820228

        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

    Viewing 0 reply threads
    Reply To: Access 2000 and ASP (Access 2000 SR1)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: