把数据导出为WEB的形式 各位高手,小弟我有个问题想请教下。怎样可以把我查询出来的内容导出为WEB的形式。还有一个问题。VB点可以发邮件啊。急用的,请大家要在两二天内帮下我。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用写文件的方式生成html即可发邮件可以用winsock控件 Public Sub createhtmlmzmx(rs As Recordset, strpath As String)Dim MaxCol, MaxRows As IntegerDim source As Stringrs.MoveFirstMaxRows = rs.RecordCountsource = "<html>" & vbCrLfsource = 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" & ">" & vbCrLfsource = source & "<div align=" & "center" & "><span class=" & "title" & ">出土地列表</span> </div>" & vbCrLfsource = source & "<table width=778 border=0 cellpadding=0 cellspacing=1 bgcolor=" & "#999999" & ">" & vbCrLfsource = source & "<tr align=" & "center" & " class=" & "head" & ">"source = source & "<td >文书列表</td>" & vbCrLfsource = source & "<td >图像列表</td>" & vbCrLfsource = source & "<td >出土地点名称</td>" & vbCrLfsource = source & "<td >所属出土地</td>" & vbCrLfsource = source & "<td >出土地年代</td>" & vbCrLfsource = source & "<td >发掘时间</td>" & vbCrLfsource = source & "<td >备注</td>" & vbCrLfsource = source & "</tr>"Dim x, row, col As IntegerFor 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>" & vbCrLfNext rowsource = source & "</table>" & vbCrLfsource = source & "</body>" & vbCrLfsource = source & "</html>" & vbCrLfOpen strpath & "\" & "index.htm" For Output As #1Print #1, sourceClose #1rs.MoveFirstEnd Sub 我想问下,自己编写的OCX控件如何在窗体控制 请问,VB中的SUB 和FUNCTION有什么区别?? 征求更多猜想:假如我们上班不需要用电脑,情况会是怎么样的? VB不用控件可以吗? 如何实现“手机工作室”样子的界面? 请问怎样在代码在动态增加菜单项? 怎么转换UTF-8编码的URL编码??在线等!! 深圳的大虾请进(最好是自由职业者):只要是深圳的大虾,来者均有分奉送 怎样使自己的程序窗体永远再上面,再她下面的其他软件仍可用1,想网络蚂蚁?急! 请问各位大虾,jpg和gif格式怎样转为bmp格式? 求救!!! VB与ORACLE连接的问题!
发邮件可以用winsock控件
Dim MaxCol, MaxRows As Integer
Dim source As Stringrs.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 rowsource = source & "</table>" & vbCrLf
source = source & "</body>" & vbCrLf
source = source & "</html>" & vbCrLfOpen strpath & "\" & "index.htm" For Output As #1
Print #1, source
Close #1
rs.MoveFirstEnd Sub