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

Output Data from SQL Tables 1

Status
Not open for further replies.

roaml

Technical User
Feb 19, 2002
264
US
Hi,

I need help on resolving a problem. I have two separate SQL tables that I am outputting data from. One section of the form outputs Work Order information and the second section of the form outputs Project information. I know how to apply the Select statements to output the individual sections, this works fine, but if there are no Projects in the table associated with the record ID, the page will not open properly. It will open and display the Work Order information but errors at the Project information.

What am I doing wrong?

Appreciate any help.
 
IF not objRS.EOF then
'Output here
End IF




>:):O> wASP >:):O>
 
Hi wASP, thanks for your suggestion to my problem.

Can you tell me what I am doing wrong here, I receive an Expected Statement error. I have listed part of my code below:

<%
mysql = &quot;SELECT * FROM WO_Info where wo_number=&quot; & Request.QueryString(&quot;RecordID&quot;)Set RS = DataConn.Execut(mysql)

IF not objRS.EOF then

‘My Output
<tr>
<td class=&quot;small&quot; colspan=&quot;2&quot;><li
class=&quot;bullettext&quot;><strong>  WORK ORDER
INFORMATION </font> </strong></td>
</tr>
<tr>
<td class=&quot;small&quot; width=&quot;20&quot;> </td>
<td width=&quot;701&quot; class=&quot;small&quot;>
<tr>
<td class=&quot;small&quot; width=&quot;20&quot;> </td>
<td class=&quot;small&quot;>

<table border=&quot;0&quot; style=&quot;border-collapse: collapse&quot;
bordercolor=&quot;#111111&quot; width=&quot;100%&quot; >
<tr>
<td class=&quot;small&quot; width=&quot;249&quot; >WO Date:  
<%=RS(&quot;wo_date&quot;)%></td>
<td class=&quot;small&quot; width=&quot;330&quot; >Project
Lead:  <%=RS(&quot;[project_lead&quot;)%></td>
<td class=&quot;small&quot; >Department:  <%=RS
(&quot;department&quot;)%></td>
<td width=&quot;160&quot; class=&quot;small&quot; >Order
Date:  <%=RS(&quot;order_date&quot;)%></td>
</tr>
End IF
%>

Thanks again for your help.
 
try replacing with below :

<%
mysql = &quot;SELECT * FROM WO_Info where wo_number=&quot; & Request.QueryString(&quot;RecordID&quot;)
Set RS = DataConn.Execute(mysql)

IF not objRS.EOF then
'My Output
%>
<tr>
<td class=&quot;small&quot; colspan=&quot;2&quot;><li
class=&quot;bullettext&quot;><strong>WORK ORDER INFORMATION </font> </strong></td>
</tr>
<tr>
<td class=&quot;small&quot; width=&quot;20&quot;> </td>
<td width=&quot;701&quot; class=&quot;small&quot;>
<tr>
<td class=&quot;small&quot; width=&quot;20&quot;> </td>
<td class=&quot;small&quot;>

<table border=&quot;0&quot; style=&quot;border-collapse: collapse&quot; bordercolor=&quot;#111111&quot; width=&quot;100%&quot; >
<tr>
<td class=&quot;small&quot; width=&quot;249&quot; >WO Date: <%=RS(&quot;wo_date&quot;)%></td>
<td class=&quot;small&quot; width=&quot;330&quot; >Project Lead: <%=RS(&quot;[project_lead&quot;)%></td>
<td class=&quot;small&quot; >Department: <%=RS(&quot;department&quot;)%></td>
<td width=&quot;160&quot; class=&quot;small&quot; >Order Date: <%=RS(&quot;order_date&quot;)%></td>
</tr>
<%End IF%>

>:):O> wASP >:):O>
 
apologies, mistake at line &quot;IF not objRS.EOF then
&quot;, should be &quot;IF not RS.EOF then&quot;

>:):O> wASP >:):O>
 
wASP,

You are the BEST!!!! Thanks alot, it is working fine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top