我的整个搜索功能的代码是这样子的:(好像没有把recordsource里面的东西和recordset里面的联系起来,请问我该怎么样把他们联系起来?)
Dim aa As String
aa = CStr(Mid(s, 19, 4))
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 # " & DateValue(""" & CDate(Mid(s, 23, 10)) & """) & "# And #" & DateValue(""" & CDate(Mid(s, 33, 10)) & """) & "#"
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 "记录文件已导出。"