Dim aa As String
aa = CStr(Mid(s, 19, 4)) s="2006-05-08" aa取出其中什么字符,s的长度只有10
Dim strFileName As String '文件名
Dim lngHandle As Long '句柄
Dim strWrite As String '要写入的文本内容
strFileName = "c:\test1.txt"
lngHandle = FreeFile() '取得句柄
Adodc2.RecordSource = "select * from 交易明细 where 账号='" & aa & "' " 'And 交易日期 Between # " & CDate(s) & "# And #" & CDate(s) & "#"
Adodc2.Refresh
Adodc2.Recordset.Update
Adodc2.Recordset.MoveFirst
strWrite = Adodc2.Recordset.GetString(adClipString, Adodc2.Recordset.RecordCount, vbTab, vbCrLf, "null")
Open strFileName For Output As lngHandle '打开文件
Print #lngHandle, strWrite '写入文本
Close lngHandle '关闭文件
SockServer.SendData "记录文件已导出。"
[此贴子已经被作者于2006-5-9 8:36:12编辑过]