各位高手,小弟我有个问题想请教下。
怎样可以把我查询出来的内容导出为WEB的形式。
还有一个问题。VB点可以发邮件啊。急用的,请大家要在两二天内帮下我。

解决方案 »

  1.   

    用写文件的方式生成html即可
    发邮件可以用winsock控件
      

  2.   

    Public Sub createhtmlmzmx(rs As Recordset, strpath As String)
    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