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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help Please ASAP with Table Results

Status
Not open for further replies.

linuxjr

Programmer
Jun 2, 2001
135
US
I have a script query.asp that produces popup calendars to fill in the fields with dates and then click on submit
and here is the code for the results.asp

<HTML>
<BODY>
<%
Dim strBeginDate
Dim strEndDate

strBeginDate = request.querystring(&quot;beginningdate&quot;)
strEndDate = request.querystring(&quot;enddate&quot;)

Dim oRSp
Set oRSp = Server.CreateObject(&quot;ADODB.Recordset&quot;)


SQLtxt= &quot;SELECT * FROM test WHERE (((test.Date) Between #&quot;& strBeginDate & &quot;# And #&quot;&strEndDate&&quot;#));&quot;

oRSp.Open SQLtxt, &quot;DSN=test&quot;
oRSp.MoveFirst
Response.Write &quot;<TABLE BORDER=1><TR>&quot;
'Header Row
For Each oHeader in oRSp.Fields
Response.Write &quot;<TH>&quot; & oHeader.name & &quot;</TH>&quot;
Next
Response.Write &quot;</TR><TR><TD>&quot;
'Data Rows
Response.Write oRSp.GetString ,,&quot;</TD><TD>&quot;,&quot;</TD></TR><TR><TD>&quot;)
Response.Write &quot;</TD></TR></TABLE>&quot;
oRSp.Close
Set oRSp = nothing
%>
</BODY>
</HTML>

I wanted to get the dates which I do and then produce a spreadsheet like table which I got here. So here is my two things:

1) where do I add so at the end of each row there is a hyperlink to call up my form where this information was entered in and opens it filling the fields with the information from the database?

2) Just curious how do you still draw the lines even if the field is blank I am curious since it will not do a complete when there may be some empty fields since not all fields are required.

Any suggestions be appreciated. Have a great day.

 
i have a pop calender which i use,
got it off the web somewhere (cant remember where) it works really well,
if you give me your email addy i can send it to ya!
 
I need to be clear I already have the popup calendar function. I do appreciate you offering to give me a copy. I was stating that I have made several scripts that all of these are together.

I have a report.asp which is a simple form that takes information. When the user clicks on submit it inserts into an access database and emails a copy to the webmaster.

Now I am making two new scripts 1) is the query.asp

Which is two textfields and beside them is calendar buttons to popup the calendar and whatever the user selects will be the date in the field. So the two fields is Begin Date and End Date to select a query to run a report so to speak of all the records between the dates.

Which comes to my results.asp above in my previous post and I was just curious how at the end of each row EX:

Name Street
-----------
John 123 no land
Jane 243 no land

is how to put a field at the end which will come after street with a link that will basically take that information and call my form file and fill in the fields to have sort of a Full Details feature.

The second I was curious. The code works but if there is no information in the field it doesn't draw the square of my tables and I was curious what I also need to change to get it to draw regardless if there is a value or not. I hope this clears some up.
 
When displaying info from a table ...
first why don't you hardcode the column headings first .. it will make your script quicker.

Second, when going through the records why don't you use
Code:
oRsp.MoveFirst
' next check if rs wasn't empty
if (oRsp.EOF) & (oRsp.BOF) Then
   Response.Write &quot;No data&quot;
Else
   Response.Write &quot;<TABLE>&quot;
   While Not(oRsp.EOF)
      Response.Write &quot;<TR><TD>&quot; & oRsp(0) & &quot;</TD><TD>&quot; & oRsp(1) & &quot;</TD></TR>&quot;
      oRsp.MoveNext
   Wend
End If
since u only have 2 fields in a table this is no big deal and this code will draw the lines even if the field is empty
 
What about if there is 20 columns? I was just giving an example and I have added your code and it doesn't draw the lines around the field if it was blank or not. It still leaves a gap in the fields that are blank. Thanks for the suggestions. Any sites or places that made have examples that I could study would be greatly appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top