Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2006
    Posts
    24

    Unanswered: Need Some Access Help

    Can you pull include files from an access db?

    I have this pulling from an access db:
    <table summary="This table is for layout purposes only" border="0" width="100%" cellspacing="0" cellpadding="0" id="table1">
    <tr>
    <td>
    <p align="center">
    <img border="0" src="images/rightside/customer_remarks.gif" width="160" height="37">
    </td>
    </tr>
    <tr>
    <td>
    <p align="center">
    <!--#include file="random_testimonials.asp"--></td>
    </tr>

    </table>

    and it wont work. If I just add <!--#include file="random_testimonials.asp"--> on any page without pulling it from the db it works fine.

    The deal is that on rightside.asp I have broken up into 6 sections and i want to pull from the db what displays there based on what page you are on.

    Can someone help me figure out how to make this work.

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    variables declared in your calling page will be available for use inside your include file, try that...
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Nov 2006
    Posts
    24

    the include file

    This is what the include file looks like:

    <p align="center"><font size="1" color="#675E4F" face="verdana">
    <% ' ADO Constant. Dont change this
    'Const adCmdText = &H0001

    ' Connection string and SQL statement
    ' Dim query, connStr
    query = "select * from Remarks"
    connStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & _
    Server.MapPath(".") & "\fpdb\scpr.mdb"


    ' Opening database
    'Dim rs
    Set rs = Server.CreateObject("ADODB.Recordset")
    rs.Open query, connStr, 3, , adCmdText

    ' Generating random number from total number of records
    'Dim intRnd
    Randomize Timer
    intRnd = (Int(RND * rs.RecordCount))

    ' Now moving the cursor to random record number
    rs.Move intRnd

    if session("sp")="" then
    Response.write "Click on the name to view the entire testimonial" & "<br><br>"
    else
    Response.write "Chasque encendido el nombre para ver el testimonial entero" & "<br><br>"
    end if

    ' Showing the random statement
    Response.Write "<b>" & " <a target='_parent' href='remarks.asp?id=" & rs("ID") & "'> " & rs("Remark_From" & prefixtable) & "</a><br>" & rs("Company_Name" & prefixtable) & "<br><br>" & rs("Minor_Quote" & prefixtable) & "</b>"
    %>
    <%

    ' Closing the database
    rs.Close
    Set rs = Nothing
    %>
    </p>

  4. #4
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Ok, so what's not working exactly?
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  5. #5
    Join Date
    Nov 2006
    Posts
    24

    include

    When i call for the include page from the db it wont work but if i put the include page directly onto any page it works.

  6. #6
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    I don't understand how you "call the include page from the db"?
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  7. #7
    Join Date
    Nov 2006
    Posts
    24

    Access

    ok in the database i have a memo field named "Right_Section_1". In "Right_Section_1" I have the following:

    <table summary="This table is for layout purposes only" border="0" width="100%" cellspacing="0" cellpadding="0" id="table1">
    <tr>
    <td>
    <p align="center">
    <img border="0" src="images/rightside/customer_remarks.gif" width="160" height="37">
    </td>
    </tr>
    <tr>
    <td>
    <p align="center">
    <!--#include file="random_testimonials.asp"--></td>
    </tr>

    </table>

    On a page named rightside.asp I have the following:
    <%if Right_Section_1<>"" then%>
    <tr>
    <td><% =rs("Right_Section_1") %></td>
    </tr>
    <%end if%>

    Thereby pulling the above with the include page from the db. When I do this the include page doesn't function. However, if I add the include page to any page without pulling from the db it will work or of I have it pull from the db inside an inline frame it will work.

Posting Permissions

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