September 18, 2006 at 3:39 pm
Folks, I jus need to write a simple ASP page to pull records [either select, view results from sql and display it on web page]....
Ideally, I would make the asp page for reporting purpose... I understand this cant be answered here...jsut give me the pointers [useful url's, link to some sites] for me to get started.....
Thanks for the help here...
September 19, 2006 at 3:31 am
If it is simple you are after, have a look at sp_makewebtask in BOL.
September 19, 2006 at 4:14 am
I just googled "ASP select sql" and lots of sites came up that seemed like they would help you. There are lots of forums that are more oriented towards ASP than SQL, and I think you would get better answers in one of them.
Dick
September 19, 2006 at 8:24 am
Here's a simple one; it won't run because I've removed some stuff and you need the include, which is the connection string, but it will give you an idea:
<!--#Include File="sqldef.asp"-->
<%
FirstLogID = Request.Querystring("FirstLogID")
LastLogID = Request.Querystring("LastLogID")
set conntemp=server.createobject("adodb.connection")
conntemp.open myDSN
mySQL="select a.TransmissionID, a.Description from TransmissionMaster a, TransmissionLogPointer b where a.TransmissionID = b.TransmissionID"
set rstemp=conntemp.execute(mySQL)
TransmissionID = rstemp("TransmissionID")
Transmission = rstemp("Description")
mySQL="Select * from TransmissionLog where LogID between " & FirstLogID & " and " & LastLogID
set rstemp=conntemp.execute(mySQL)
howmanyfields=rstemp.fields.count - 1
'response.write "howmanyfields=" & howmanyfields & "<br>"
%>
<html><head>
<title>Edge Pull Transmission Report</title>
<meta http-equiv="pragma" content="no-cache">
</head>
<body bgcolor="#FFFFFF" bgproperties="fixed">
<B>Detail Log for Transmission <%=TransmissionID%> (<%=Transmission%><br></B>
<table border="1" width="100%" align="left" bgcolor="#FFFFFF">
<tr>
<%
for i = 0 to howmanyfields%>
<td valign="top" class="clsTablebody"><%=rstemp.fields(i).name%> </td>
<% next %>
</tr>
<% do while not rstemp.eof %>
<tr>
<% for i = 0 to howmanyfields%>
<td valign="top" class="clsTablebody"><%=rstemp(i)%> </td>
<% next %>
</tr>
<%
rstemp.movenext
loop
rstemp.close
set rstemp=nothing
conntemp.close
set conntemp=nothing
%>
</table>
</body>
</html>
September 19, 2006 at 1:01 pm
http://www.asp101.com has easy to follow tutorials on how to do this. Just go to the samples section.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply