Click to See Complete Forum and Search --> : Writing a simple reports from ASP
tompod
Sep 19th, 2000, 05:00 AM
Hi
Can anybody tell me how to write a simple report
based on databased query!
Thanks,
Tomaz
monte96
Sep 19th, 2000, 01:27 PM
If you just trying to display data from a database that's pretty easy:
<%
Dim cn
Dim rs
Dim strSQL
Dim intLoop
Set cn = Server.CreateObject("ADODB.Connection")
cn.ConnectionString = "Provider=SQLOLEDB;Server=" & servername & ";Database=" & dbname & ";UID=" & userid & ";Pwd=" & pwd & ";"
cn.Open
strSQL = "Select * from table"
Set rs = cn.Execute(strSQL,9999999)
%>
<HTML>
<BODY>
<TABLE border=1 cellspacing=0 cellpadding=0>
<%Do until rs.EOF%>
<TR>
<%For intLoop = 0 to rs.Fields.Count - 1%>
<TD><%rs.Fields(intLoop)%></TD>
<%Next%>
</TR>
<%rs.MoveNext%>
<%Loop%>
</TABLE>
</BODY>
</HTML>
<%
rs.Close
cn.Close
Set rs = Nothing
Set cn = Nothing
%>
Now if your talking about doing something in Crystal, well... that puts a whole new paint job on things...
It's a little more complicated but not that difficult.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.