I'm attempting to automate a process at my job where we import data into an Access Database, run a series of queries to modify the data, then export the modified data. What I'm attempting to do is just make a VB script in the folder that you click on and then it does everything automatically. I know I can open the database using the following code:
Then put what I want to execute between
But I'm unsure how to get it to run a module or a query. All I've ever done with this before is execute SQL code. Is there some way to run a module using this?
Code:
Set ProcessDB = CreateObject("ADODB.Connection")
ProcessDB.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"User ID=;Data Source=" & ProcessDatabase
Then put what I want to execute between
Code:
ProcessDB.Open
ProcessDB.Close
But I'm unsure how to get it to run a module or a query. All I've ever done with this before is execute SQL code. Is there some way to run a module using this?