S
SSweez
I have the following code that I wish to execute from Excel that will
compact an Acess 2003 database. However I get an error that says
"Unrecognized Database Format." I have tried variations of text "MS
Access" such as "Acess" and "Microsoft Acess" without success. Does
anyone know the proper way to write this?
Sub test()
Dim db As DAO.Database
Dim str1 As String
Dim str2 As String
Dim str3 As String
str1 = "c:\db1.mdb"
Set db = OpenDatabase(str1, True, False, "MS
Access;password=password")
db.Close
str2 = Dir(str1)
str3 = Left(str1, Len(str1) - Len(str2)) & "temp.mdb"
DBEngine.CreateDatabase str1, str3
Kill str1
Name str3 As str1
End Sub
Thanks!
compact an Acess 2003 database. However I get an error that says
"Unrecognized Database Format." I have tried variations of text "MS
Access" such as "Acess" and "Microsoft Acess" without success. Does
anyone know the proper way to write this?
Sub test()
Dim db As DAO.Database
Dim str1 As String
Dim str2 As String
Dim str3 As String
str1 = "c:\db1.mdb"
Set db = OpenDatabase(str1, True, False, "MS
Access;password=password")
db.Close
str2 = Dir(str1)
str3 = Left(str1, Len(str1) - Len(str2)) & "temp.mdb"
DBEngine.CreateDatabase str1, str3
Kill str1
Name str3 As str1
End Sub
Thanks!