'dim....
'路径,是否存在
cPath = CurrentProject.Path
If Right(cPath, 1) <> "/" Then cPath = cPath & "/"
'sFile = "Dashboard.mdb"
If IsNull(sFile) Or Trim(sFile) = "" Or Right(sFile, 4) <> ".mdb" Then
MsgBox "file name error"
Exit Sub
End If
Set tmpFSO = CreateObject("Scripting.FileSystemObject")
If tmpFSO.FileExists(cPath & sFile) Then
'tmpFSO.DeleteFile cPath & sFile
MsgBox sFile & " has exist"
Exit Sub
End If
Set tmpFSO = Nothing
’创建
Set accessApp = CreateObject("Access.Application")
accessApp.CreateNewWorkgroupFile (cPath & sFile)
‘写入数据
sql_str = " select * into [" & cPath & sFile & "].T_summary from T_summary "
Call DoCmd.RunSQL(sql_str, True)
'路径,是否存在
cPath = CurrentProject.Path
If Right(cPath, 1) <> "/" Then cPath = cPath & "/"
'sFile = "Dashboard.mdb"
If IsNull(sFile) Or Trim(sFile) = "" Or Right(sFile, 4) <> ".mdb" Then
MsgBox "file name error"
Exit Sub
End If
Set tmpFSO = CreateObject("Scripting.FileSystemObject")
If tmpFSO.FileExists(cPath & sFile) Then
'tmpFSO.DeleteFile cPath & sFile
MsgBox sFile & " has exist"
Exit Sub
End If
Set tmpFSO = Nothing
’创建
Set accessApp = CreateObject("Access.Application")
accessApp.CreateNewWorkgroupFile (cPath & sFile)
‘写入数据
sql_str = " select * into [" & cPath & sFile & "].T_summary from T_summary "
Call DoCmd.RunSQL(sql_str, True)