If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > displaying it on html

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-15-04, 21:42
min min min min is offline
Registered User
 
Join Date: Jul 2004
Posts: 1
Question displaying it on html

i'm not too sure abt displaying it in html table . so any advice ?

my code look like this .

sql = "SELECT sDetail.* FROM sDetail, newDetail where sDetail.semyear=newDetail.semyear and sDetail.sem=newDetail.sem and sDetail.modulecode=newDetail.modulecode and sDetail.tutorial=newDetail.tutorial and sDetail.startTime=newDetail.startTime and sDetail.endTime=newDetail.endTime and sDetail.location=newDetail.location and sDetail.roomno=newDetail.roomno and sDetail.tutor=newDetail.tutor"

this is for comparing my two tables . for i hav 10 same rows in both tables . but onli my newDetail (2nd table) hav new rows and some rows with onli slight changes .

set oConn=Server.CreateObject("ADODB.Connection")
oConn.Open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=fSearch;Data Source=L311C04"

sql="select newDetail,* from newDetail left join sDetail on (newDetail.semyear=sDetail.semyear and newDetail.sem=sDetail.sem and newDetail.modulecode=sDetail.modulecode and newDetail.tutorial=sDetail.tutorial and newDetail.startTime=sDetail.startTime and newDetail.endTime=sDetail.endTime and newDetail.location=sDetail.location and newDetail.roomno=sDetail.roomno and newDetail.tutor=sDetail.tutor) where sDetail.semyear is not null"

it works . but i want it to display in html tsble . this part i'm not too sure how to do it .
can some experts advice me on it ?

thanks
Reply With Quote
  #2 (permalink)  
Old 07-17-04, 04:37
Seppuku Seppuku is offline
Useless...
 
Join Date: Jul 2003
Location: SoCal
Posts: 721
Well, first, that will work, but you're overkill on the JOINs... if you have a single key field in each table that match, you only need to join on that one key field... otherwise you're causing much extra work for the SQL engine...

Secondly, when you want to generate an HTML table, you need to loop through the recordset. I'm going to assume you know how to execute the SQL and get the recordset, so I'm going to take it from there...
Code:
<table>
  <tr>
    <td>
      Column1
    </td>
    <td>
      Column2
    </td>
  </tr>
<%
  If NOT rs.BOF AND NOT rs.EOF Then
    While NOT rs.EOF
      Response.Write "<tr><td>" & rs("col1") & "</td><td>" & rs("col2") & "</td></tr>" & vbCRLF
      rs.MoveNext
    WEnd
  Else
%>
  <tr>
    <td colspan="2">No results returned</td>
  </tr>
<%
  End If
%>
__________________
That which does not kill me postpones the inevitable.
Reply With Quote
  #3 (permalink)  
Old 07-18-04, 22:34
Bullschmidt Bullschmidt is offline
Guru
 
Join Date: Jun 2003
Location: USA
Posts: 1,032
And www.asp101.com/samples has some good, short database examples.
__________________
J. Paul Schmidt, Freelance Web and Database Developer
www.Bullschmidt.com
Access Database Sample, Web Database Sample, ASP Design Tips
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On