|
3#
楼主 |
发表于 2007-12-4 16:24:03
|
只看该作者
Dim accessApp As Access.Application
Dim cPath As String
Dim sql_str As String
Dim sTable As String
cPath = CurrentProject.Path
If Right(cPath, 1) <> "\" Then cPath = cPath & "\"
sTable = "Dashboard.mdb"
Set tmpFSO = CreateObject("Scripting.FileSystemObject")
If tmpFSO.FileExists(cPath & sTable) Then
'tmpFSO.DeleteFile cPath & sTable
MsgBox sTable & " has exist"
Exit Sub
End If
Set tmpFSO = Nothing
Set accessApp = CreateObject("Access.Application")
accessApp.CreateNewWorkgroupFile (cPath & sTable)
sql_str = " select * into [" & cPath & sTable & "].T_summary from T_summary "
Call DoCmd.RunSQL(sql_str, True)
我这样实现的 ^_^
参考《ACCESS-VBA编程》 |
|