Become a Premium Member and unlock a new, free course in leading technologies each month.
Go Premium for a chance to win a PS4. Enter to Win
Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.
Public Sub OpenAnotherDatabase()
'Created by Helen Feddema 14-Feb-2010
'Last modified by Helen Feddema 14-Feb-2010
Dim appAccess As New Access.Application
Dim strDBNameAndPath As String
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Dim dbe As DAO.DBEngine
'Change to your db name and path
strDBNameAndPath = "G:\Documents\Access 2002-2003 Databases\General.mdb"
appAccess.Visible = True
appAccess.OpenCurrentDatabase filepath:=strDBNameAndPath, _
'Run a procedure
'Run a macro
'Run an action query
'Run SQL code
strSQL = "DELETE tblOrders.ShippedDate FROM tblOrders WHERE ShippedDate = #8/4/1994#;"
Debug.Print "SQL string: " & strSQL
'Iterate through a recordset
Set dbe = appAccess.DBEngine
Set dbs = dbe.OpenDatabase(strDBNameAndPath)
Set rst = dbs.OpenRecordset("tblCategories")
Do Until rst.EOF
Set dbs = Nothing
Set appAccess = Nothing
Open in new window
Author Closing Comment
Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.
If you are experiencing a similar issue, please ask a related question
Join the community of 500,000 technology professionals and ask your questions.
Join & Ask a Question
Join our community for more solutions or to ask questions.
For immediate help use Live now!