Fordraiders
asked on
convert code to vba 2010
access vba 2010 needed:
Is there a different way to write this code for office 2010 vba ?
This code runs a macro from an outside database and then compacts and repairs it..
Public Sub RunSap6()
Const dbPathName = "C:\Program Files\Crs\Sapbackend6.mdb"
Dim Acc As Object, DB As Object
Set Acc = CreateObject("Access.Appli cation")
Set DB = Acc.Application.DBEngine.W orkspaces( 0).OpenDat abase(dbPa thName, 0, False)
Acc.OpenCurrentDatabase dbPathName, False
Acc.DoCmd.RunMacro "DeleteMain_2012_All"
DB.Close
Set Acc = Nothing
Set DB = Nothing
' backend6
gsDBPath = "C:\Program Files\Crs\"
On Error Resume Next
Kill gsDBPath + "Sapbackend62.mdb"
DBEngine.CompactDatabase gsDBPath + "Sapbackend6.mdb", gsDBPath + "Sapbackend62.mdb"
Kill gsDBPath + "Sapbackend6.mdb"
Name gsDBPath + "Sapbackend62.mdb" As gsDBPath + "Sapbackend6.mdb"
End Sub
Thanks
fordraiders
Is there a different way to write this code for office 2010 vba ?
This code runs a macro from an outside database and then compacts and repairs it..
Public Sub RunSap6()
Const dbPathName = "C:\Program Files\Crs\Sapbackend6.mdb"
Dim Acc As Object, DB As Object
Set Acc = CreateObject("Access.Appli
Set DB = Acc.Application.DBEngine.W
Acc.OpenCurrentDatabase dbPathName, False
Acc.DoCmd.RunMacro "DeleteMain_2012_All"
DB.Close
Set Acc = Nothing
Set DB = Nothing
' backend6
gsDBPath = "C:\Program Files\Crs\"
On Error Resume Next
Kill gsDBPath + "Sapbackend62.mdb"
DBEngine.CompactDatabase gsDBPath + "Sapbackend6.mdb", gsDBPath + "Sapbackend62.mdb"
Kill gsDBPath + "Sapbackend6.mdb"
Name gsDBPath + "Sapbackend62.mdb" As gsDBPath + "Sapbackend6.mdb"
End Sub
Thanks
fordraiders
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER