'EXPORTS TABLE IN ACCESS DATABASE TO EXCEL 'REFERENCE TO DAO IS REQUIRED
Dim strExcelFile As String Dim strWorksheet As String Dim strDB As String Dim strTable As String Dim objDB As Database
'Change Based on your needs, or use 'as parameters to the sub strExcelFile = "C:\My Documents\MySpreadSheet.xls" strWorksheet = "WorkSheet1" strDB = "C:\My Documents\MyDatabase.mdb" strTable = "MyTable"
Set objDB = OpenDatabase(strDB)
'If excel file already exists, you can delete it here If Dir(strExcelFile) <> "" Then Kill strExcelFile
objDB.Execute _ "SELECT * INTO [Excel 8.0;DATABASE=" & strExcelFile & _ "].[" & strWorksheet & "] from " & "[" & strTable & "]" objDB.Close Set objDB = Nothing
strSQLCmd.Format(_T("select * from (select * from talk_info where %s ='%s') where %s ='%s'"), strVar,strValue,strVar2,strValue2); 请问这语句有问题吗 没有问题。 ......