'-----------------
' Path
'-----------------
MyDBPath = ThisWorkbook.Path
MyDBPath = MyDBPath & "\"
'-----------------
' Determines Database File and Table Name
'-----------------
iVersion = 2003
Select Case iVersion
Case 2007
MyDBFileName = "DBTarget.accdb"
My_SourceTable_Name = "RefTable"
My_MakeTable_Name = "RefTable_BackUp"
Case 2003, 2002, 2000
MyDBFileName = "RankValues.mdb"
My_SourceTable_Name = "EmpRev"
My_MakeTable_Name = "EmpRev_BackUp"
End Select
'-----------------
' Full DB Name
'-----------------
MyDBFullFileName = MyDBPath & MyDBFileName
'-----------------
' DB Exists
'-----------------
DBExists = Dir(MyDBFullFileName, vbDirectory)
If DBExists = vbNullString Then
MsgBox "Invalid File Name " & MyDBFullFileName & " terminating", vbCritical, "Public Sub SQL_MakeTable()"
Exit Sub
End If
'-----------------
' DAO Objects - Init
'-----------------
Set MyDB = Nothing
Set MyQDF = Nothing
Set MyTblDef = Nothing
Set MyTblDefs = Nothing
Set MyRecordSet = Nothing
'-----------------
' Open Database
'-----------------
Set MyDB = OpenDatabase(MyDBFullFileName)
End of Part Three
Bookmarks