h2q1
04-15-2007, 10:45 AM
I have some issues, please help me ... :(
First, see DB (relate with my part..)
http://quangnd0003.googlepages.com/anhthu.bmp
I want show data from DB, my code follow:
<% openConn 'open Connection
set rsMark = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM Subject"
strSQL = strSQL & " JOIN Mark ON Subject.Subject_id=Mark.Subject_id"
strSQL = strSQL & " WHERE Student_id=063106445"
rsMark.open strSQL, oConn
%>
<table width="100%" border="1" cellspacing="0" cellpadding="2">
<%
Response.Write "<tr><th>STT</th>"
Response.Write "<th>Năm học</th>"
Response.Write "<th>Học kỳ</th>"
Response.Write "<th>Môn học</th>"
Response.Write "<th>Kiểm tra</th>"
Response.Write "<th>Lần 1</th>"
Response.Write "<th>Lần 2</th>"
Response.Write "<th>Học trình</th></tr>"
%>
<%
cnt=0 'count number record
do while not rsMark.EOF
cnt = cnt + 1
%>
<tr>
<td><%=cnt%></td>
<td><%=rsMark("Year")%></td>
<td><%=rsMark("Term")%></td>
<td><%=rsMark("Subject_name")%></td>
<td><%=rsMark("Test")%></td>
<td><%=rsMark("Mark")%></td>
<td><%=rsMark("ResistMark")%></td>
<td><%=rsMark("No_of_lesson")%></td>
</tr>
<%
rsMark.Movenext
Loop
%>
</table>
and result at here:
http://quangnd0003.googlepages.com/ketqua.bmp
why data in cell Subject_name, Mark, ResistMark,No_of_lesson not display ! :(
(I tried run with SQL Query Analyzer and success...string SQL was correct! and results were returned is fully ! ... why ?)
someone explain for me ... hichic
thanks a lot !
First, see DB (relate with my part..)
http://quangnd0003.googlepages.com/anhthu.bmp
I want show data from DB, my code follow:
<% openConn 'open Connection
set rsMark = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM Subject"
strSQL = strSQL & " JOIN Mark ON Subject.Subject_id=Mark.Subject_id"
strSQL = strSQL & " WHERE Student_id=063106445"
rsMark.open strSQL, oConn
%>
<table width="100%" border="1" cellspacing="0" cellpadding="2">
<%
Response.Write "<tr><th>STT</th>"
Response.Write "<th>Năm học</th>"
Response.Write "<th>Học kỳ</th>"
Response.Write "<th>Môn học</th>"
Response.Write "<th>Kiểm tra</th>"
Response.Write "<th>Lần 1</th>"
Response.Write "<th>Lần 2</th>"
Response.Write "<th>Học trình</th></tr>"
%>
<%
cnt=0 'count number record
do while not rsMark.EOF
cnt = cnt + 1
%>
<tr>
<td><%=cnt%></td>
<td><%=rsMark("Year")%></td>
<td><%=rsMark("Term")%></td>
<td><%=rsMark("Subject_name")%></td>
<td><%=rsMark("Test")%></td>
<td><%=rsMark("Mark")%></td>
<td><%=rsMark("ResistMark")%></td>
<td><%=rsMark("No_of_lesson")%></td>
</tr>
<%
rsMark.Movenext
Loop
%>
</table>
and result at here:
http://quangnd0003.googlepages.com/ketqua.bmp
why data in cell Subject_name, Mark, ResistMark,No_of_lesson not display ! :(
(I tried run with SQL Query Analyzer and success...string SQL was correct! and results were returned is fully ! ... why ?)
someone explain for me ... hichic
thanks a lot !