用VB把数据库文件转换成Htm1格式
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim i As Integer
Dim fso As New FileSystemObject
Private Sub Form_Load()
Set db = OpenDatabase(“d:\vb98\gz9910”,False,False,“FoxPro 2.5;”)??
Set rs = db.OpenRecordset(“rsda”)??
Set fso = CreateObject(“scripting.filesystemobject”)??
If fso.FileExists(App.Path & “\test.htm”) Then
fso.DeleteFile (App.Path & “\test.htm”)??
End If
fd = FreeFile
Open “test.htm” For Append Access Write As #fd
rs.MoveFirst
Print #fd, “<html>”
Print #fd, “<head>”
Print #fd, “<title>春燕网</title>”
Print #fd, “<p align=center><font face=隶书 size= 2 color=#F2A3543><big><big><big>XX公司1999年10月工资发放表</big></big></big>”
Print #fd, “<table width=800 border=1>”
Print #fd, “ < tr >”
Print #fd, “ < td width=5% align=center > 工号 < /font >< /td>”
Print #fd, “ < td width=8% align=center > 姓名 < /strong >< /td>”
Print #fd, “ < td width=10% align=center > 部门 < /font >< /td>”
Print #fd, “ < td width=10% align=center > 职位 < /font >< /td>”
Print #fd, “ < td width=10% align=center > 籍贯 < /font >< /td>”
Print #fd, “ < td width=10% align=center > 家庭住址 < /font > </td>”
Print #fd, “ < td width=10% align=center > 联系电话 < /font > </td>”
Print #fd, “ < td width=10% align=center > 爱好 < /font > </td>”
Print #fd, “ < td width=26% align=center > 简历 < /font > </td>”
Print #fd, “< /tr >”
rs.MoveFirst
do while not rs.eof()
Print #fd, “< tr >”
Print #fd, “ <td width=5% align=center >” & rs.Fields(“gh”) & “</td>”
Print #fd, “ <td width=8% align=center >” & rs.Fields(“xm”) & “</td>”
Print #fd, “ <td width=10% align=center >” & rs.Fields(“bm”) & “</FONT>“/td”
Print #fd, “ <td width=10% align=center >” & rs.Fields(“zw”) & “</td>”
Print #fd, “ <td width=10% align=center >” & rs.Fields(“jg”) & “</td>”
Print #fd, “ <td width=10% align=center >” & rs.Fields(“dz”) & “</td>”
Print #fd, “ <td width=10% align=center >” & rs.Fields(“tele”) & “</td>”
Print #fd, “ <td width=10% align=center >” & rs.Fields(“ah”)& “</td>”
Print #fd, “ <td width=26% align=center >” & rs.Fields(“jl”) & “</td>”
Print #fd, “</tr>”
rs.MoveNext
loop
Close #fd
End Sub