帮助 MS 访问数据库到
我试图使用访问数据库更轻松地管理我的表,而不是手动将数据输入到 中。
我已经提出了基本想法,但我不知道如何完善它。另外,如果我的表格行之一(特别是最后一行)没有正好 3 个单元格,我该怎么办?
这是我到目前为止所阐述的:
<table class="tablecenter" cellspacing="30">
<tbody>
<%
sql()
SQL = Select * From Database
DR = DataReader (SQL)
While Not DR.EOF
x = 1
If x < 4 Then %>
<td><img src="avatar-blank.jpg" alt="headshot"/><br /><p>dr("Name") <br />Hometown: VarAddress <br /> Class: VarClass</p></td>
<% Else
x = 0 %>
</tr>
<tr>
<td><img src="avatar-blank.jpg" alt="headshot" /><br /><p>VarName<br />Hometown: VarAddress<br />Class: VarClass</p></td>
<% End If
x = x + 1
DR.moveNext
Wend %>
I am trying to more easily manage my table with an access database rather than manually entering data into a <table>
.
I have laid out the basic idea but I don't know exactly how to perfect it. Also what do I do if one of my table rows (specifically the last one) doesn't have exactly 3 cells?
This is what I have laid out so far:
<table class="tablecenter" cellspacing="30">
<tbody>
<%
sql()
SQL = Select * From Database
DR = DataReader (SQL)
While Not DR.EOF
x = 1
If x < 4 Then %>
<td><img src="avatar-blank.jpg" alt="headshot"/><br /><p>dr("Name") <br />Hometown: VarAddress <br /> Class: VarClass</p></td>
<% Else
x = 0 %>
</tr>
<tr>
<td><img src="avatar-blank.jpg" alt="headshot" /><br /><p>VarName<br />Hometown: VarAddress<br />Class: VarClass</p></td>
<% End If
x = x + 1
DR.moveNext
Wend %>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这取决于为什么细胞少于 3 个。如果只是缺少数据,则插入一个空的
元素。
It depends on why there are fewer than 3 cells. If it is just missing data, then insert an empty
<td>
element.