把数据导出为WEB的形式

TMacWorking 2003-10-02 11:45:49
各位高手,小弟我有个问题想请教下。
怎样可以把我查询出来的内容导出为WEB的形式。
还有一个问题。VB点可以发邮件啊。

急用的,请大家要在两二天内帮下我。
...全文
35 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
online 2003-10-08
  • 打赏
  • 举报
回复
Public Sub createhtmlmzmx(rs As Recordset, strpath As String)
Dim MaxCol, MaxRows As Integer
Dim source As String

rs.MoveFirst
MaxRows = rs.RecordCount
source = "<html>" & vbCrLf
source = source & "<STYLE type=" & " text/css" & " >"
source = source & "A:visited {"
source = source & "TEXT-DECORATION: none;"
source = source & "color: #666666;}"
source = source & "A:active { TEXT-DECORATION: none }"
source = source & " A:hover { TEXT-DECORATION: underline}"
source = source & "A:link {TEXT-DECORATION: none; color: #666666;}"
source = source & ".t { LINE-HEIGHT: 1.4 }"
source = source & "BODY { FONT-SIZE: 9pt; SCROLLBAR-HIGHLIGHT-COLOR: buttonface; SCROLLBAR-SHADOW-COLOR: buttonface; SCROLLBAR-3DLIGHT-COLOR: buttonhighlight; SCROLLBAR-TRACK-COLOR: #eeeeee; FONT-FAMILY: 宋体; SCROLLBAR-DARKSHADOW-COLOR: buttonshadow }"
source = source & " TD { FONT-SIZE: 9pt; FONT-FAMILY: 宋体 }"
source = source & "DIV { FONT-SIZE: 9pt; FONT-FAMILY: 宋体 }"
source = source & "P { FONT-SIZE: 9pt; FONT-FAMILY: 宋体 }"
source = source & "TD { FONT-SIZE: 9pt; FONT-FAMILY: 宋体 }"
source = source & "BR { FONT-SIZE: 9pt; FONT-FAMILY: 宋体 }"
source = source & ".head {font-family: 宋体;"
source = source & "font-size: 9pt;"
source = source & "font-weight: bold;"
source = source & "background-color: #DBDBDB;"
source = source & " line-height: 1.5;}"
source = source & ".title { font-family: 宋体;"
source = source & "font-size: 14px;"
source = source & "font-weight: bold;"
source = source & " color: #FF9900;"
source = source & " line-height: 2;}"
source = source & "</STYLE>"
source = source & "<body bgcolor=" & "#FFFFFF" & " text=" & "#000000" & " leftmargin=" & "5" & " topmargin=" & "5" & ">" & vbCrLf
source = source & "<div align=" & "center" & "><span class=" & "title" & ">出土地列表</span> </div>" & vbCrLf
source = source & "<table width=778 border=0 cellpadding=0 cellspacing=1 bgcolor=" & "#999999" & ">" & vbCrLf
source = source & "<tr align=" & "center" & " class=" & "head" & ">"

source = source & "<td >文书列表</td>" & vbCrLf
source = source & "<td >图像列表</td>" & vbCrLf
source = source & "<td >出土地点名称</td>" & vbCrLf
source = source & "<td >所属出土地</td>" & vbCrLf
source = source & "<td >出土地年代</td>" & vbCrLf
source = source & "<td >发掘时间</td>" & vbCrLf
source = source & "<td >备注</td>" & vbCrLf
source = source & "</tr>"
Dim x, row, col As Integer
For row = 0 To MaxRows - 1
source = source & "<tr bgcolor=" & "#FFFFFF" & ">" & vbCrLf
'For col = 0 To 5
source = source & "<td ><a href=" & rs.Fields("mzmc") & "\index.htm > " & rs.Fields("id").Value & " </a></td>" & vbCrLf
source = source & "<td ><a href=" & rs.Fields("mzmc") & "\list.htm > " & rs.Fields("id").Value & " </a></td>" & vbCrLf
'If Row Mod 2 = 0 Then
source = source & "<td > " & rs.Fields("mzmc").Value & " </td>" & vbCrLf
source = source & "<td > " & rs.Fields("mc").Value & " </td>" & vbCrLf
source = source & "<td > " & rs.Fields("mznd").Value & " </td>" & vbCrLf
source = source & "<td > " & rs.Fields("fjsj").Value & " </td>" & vbCrLf
source = source & "<td > " & rs.Fields("memo").Value & " </td>" & vbCrLf
'Else
' source.Text = source.Text & "<td bgcolor=#99FFCC> " & MyGrid.Text & " </td>" & vbCrLf
'End If
'Next col
rs.MoveNext
source = source & "</tr>" & vbCrLf
Next row

source = source & "</table>" & vbCrLf
source = source & "</body>" & vbCrLf
source = source & "</html>" & vbCrLf

Open strpath & "\" & "index.htm" For Output As #1
Print #1, source
Close #1
rs.MoveFirst

End Sub
online 2003-10-03
  • 打赏
  • 举报
回复
用写文件的方式生成html即可
发邮件可以用winsock控件
web700 2003-10-03
  • 打赏
  • 举报
回复
有专门的控件可以搞定的

807

社区成员

发帖
与我相关
我的任务
社区描述
VB 多媒体
社区管理员
  • 多媒体
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧