Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP page from Access

Status
Not open for further replies.

jarcat

IS-IT--Management
Sep 19, 2001
2
AU
I have used the "export to" option in Access to take my query across to an ASP page in my web. The query page appears as does the results page, however when you preview in a browser and enter criteria in the query, no results come back. Checking the same in Access and all works fine. I am using a test environment with Personal Web Server on a local machine.
Any help or suggestions would be greatly appreciated.
Thanks
 
Please place your code to see what is the problem... ________
George, M
 
Thanks for the review:
The copy is here:
Any help much appreciated.
Rgds

<HTML>
<HEAD>
<META HTTP-EQUIV=&quot;Content-Type&quot; CONTENT=&quot;text/html;charset=windows-1252&quot;>
<TITLE>res details Query</TITLE>
</HEAD>
<BODY>
<%
If IsObject(Session(&quot;ian.dsn_conn&quot;)) Then
Set conn = Session(&quot;ian.dsn_conn&quot;)
Else
Set conn = Server.CreateObject(&quot;ADODB.Connection&quot;)
conn.open &quot;ian.dsn&quot;,&quot;&quot;,&quot;&quot;
Set Session(&quot;ian.dsn_conn&quot;) = conn
End If
%>
<%
If IsObject(Session(&quot;res_details_Query_rs&quot;)) Then
Set rs = Session(&quot;res_details_Query_rs&quot;)
Else
sql = &quot;SELECT [res details].[masterfile], [res details].[reservation ID], [res details].[first name], [res details].[last name], [res details].[event], [res details].[performance], [res details].[date], [res details].[time], [res details].[section], [res details].[seat], [res details].[price], [res details].[row] FROM [res details] WHERE ((([res details].[masterfile])=&quot; & Request.QueryString(&quot;&quot; & Request.QueryString(&quot;[Enter &quot;) & &quot;Ma&quot;) & &quot;sterfile:]) And (([res details].[reservation ID])=&quot; & Request.QueryString(&quot;[Enter &quot;) & &quot;res id:])) &quot;
Set rs = Server.CreateObject(&quot;ADODB.Recordset&quot;)
rs.Open sql, conn, 3, 3
If rs.eof Then
rs.AddNew
End If
Set Session(&quot;res_details_Query_rs&quot;) = rs
End If
%>
<TABLE BORDER=1 BGCOLOR=#ffffff CELLSPACING=0><FONT FACE=&quot;Arial&quot; COLOR=#000000><CAPTION><B>res details Query</B></CAPTION></FONT>

<THEAD>
<TR>
<TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT SIZE=2 FACE=&quot;Arial&quot; COLOR=#000000>masterfile</FONT></TH>
<TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT SIZE=2 FACE=&quot;Arial&quot; COLOR=#000000>reservation ID</FONT></TH>
<TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT SIZE=2 FACE=&quot;Arial&quot; COLOR=#000000>first name</FONT></TH>
<TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT SIZE=2 FACE=&quot;Arial&quot; COLOR=#000000>last name</FONT></TH>
<TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT SIZE=2 FACE=&quot;Arial&quot; COLOR=#000000>event</FONT></TH>
<TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT SIZE=2 FACE=&quot;Arial&quot; COLOR=#000000>performance</FONT></TH>
<TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT SIZE=2 FACE=&quot;Arial&quot; COLOR=#000000>date</FONT></TH>
<TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT SIZE=2 FACE=&quot;Arial&quot; COLOR=#000000>time</FONT></TH>
<TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT SIZE=2 FACE=&quot;Arial&quot; COLOR=#000000>section</FONT></TH>
<TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT SIZE=2 FACE=&quot;Arial&quot; COLOR=#000000>seat</FONT></TH>
<TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT SIZE=2 FACE=&quot;Arial&quot; COLOR=#000000>price</FONT></TH>
<TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT SIZE=2 FACE=&quot;Arial&quot; COLOR=#000000>row</FONT></TH>

</TR>
</THEAD>
<TBODY>
<%
On Error Resume Next
rs.MoveFirst
do while Not rs.eof
%>
<TR VALIGN=TOP>
<TD BORDERCOLOR=#c0c0c0 ALIGN=RIGHT><FONT SIZE=2 FACE=&quot;Arial&quot; COLOR=#000000><%=Server.HTMLEncode(rs.Fields(&quot;masterfile&quot;).Value)%><BR></FONT></TD>
<TD BORDERCOLOR=#c0c0c0 ALIGN=RIGHT><FONT SIZE=2 FACE=&quot;Arial&quot; COLOR=#000000><%=Server.HTMLEncode(rs.Fields(&quot;reservation ID&quot;).Value)%><BR></FONT></TD>
<TD BORDERCOLOR=#c0c0c0 ><FONT SIZE=2 FACE=&quot;Arial&quot; COLOR=#000000><%=Server.HTMLEncode(rs.Fields(&quot;first name&quot;).Value)%><BR></FONT></TD>
<TD BORDERCOLOR=#c0c0c0 ><FONT SIZE=2 FACE=&quot;Arial&quot; COLOR=#000000><%=Server.HTMLEncode(rs.Fields(&quot;last name&quot;).Value)%><BR></FONT></TD>
<TD BORDERCOLOR=#c0c0c0 ><FONT SIZE=2 FACE=&quot;Arial&quot; COLOR=#000000><%=Server.HTMLEncode(rs.Fields(&quot;event&quot;).Value)%><BR></FONT></TD>
<TD BORDERCOLOR=#c0c0c0 ><FONT SIZE=2 FACE=&quot;Arial&quot; COLOR=#000000><%=Server.HTMLEncode(rs.Fields(&quot;performance&quot;).Value)%><BR></FONT></TD>
<TD BORDERCOLOR=#c0c0c0 ALIGN=RIGHT><FONT SIZE=2 FACE=&quot;Arial&quot; COLOR=#000000><%=Server.HTMLEncode(rs.Fields(&quot;date&quot;).Value)%><BR></FONT></TD>
<TD BORDERCOLOR=#c0c0c0 ALIGN=RIGHT><FONT SIZE=2 FACE=&quot;Arial&quot; COLOR=#000000><%=Server.HTMLEncode(rs.Fields(&quot;time&quot;).Value)%><BR></FONT></TD>
<TD BORDERCOLOR=#c0c0c0 ><FONT SIZE=2 FACE=&quot;Arial&quot; COLOR=#000000><%=Server.HTMLEncode(rs.Fields(&quot;section&quot;).Value)%><BR></FONT></TD>
<TD BORDERCOLOR=#c0c0c0 ALIGN=RIGHT><FONT SIZE=2 FACE=&quot;Arial&quot; COLOR=#000000><%=Server.HTMLEncode(rs.Fields(&quot;seat&quot;).Value)%><BR></FONT></TD>
<TD BORDERCOLOR=#c0c0c0 ALIGN=RIGHT><FONT SIZE=2 FACE=&quot;Arial&quot; COLOR=#000000><%=Server.HTMLEncode(rs.Fields(&quot;price&quot;).Value)%><BR></FONT></TD>
<TD BORDERCOLOR=#c0c0c0 ><FONT SIZE=2 FACE=&quot;Arial&quot; COLOR=#000000><%=Server.HTMLEncode(rs.Fields(&quot;row&quot;).Value)%><BR></FONT></TD>

</TR>
<%
rs.MoveNext
loop%>
</TBODY>
<TFOOT></TFOOT>
</TABLE>
</BODY>
</HTML>
 
Have u printed out the sql string, to see if is ok? ________
George, M
 
When you say, &quot;Preview in browser&quot;... that makes it sound suspiciously like previewing it directly from your design software, which will not work...

You said you are using PWS, but are you typing in the address to look at the page like:

???

where 'dirPath' is the share name that you set up in PWS and 'page.asp' is the name of your file.
penny.gif
penny.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top