Update Access Database from VBScript

mikebrewer

Registered User.
Local time
Today, 15:25
Joined
Sep 28, 2011
Messages
93
I apologize if I've got this into the wrong section. I'm trying to connect to an Access 2010 database from Windows Server 2008 so that I can update 1 field in the table. My goal is that I'll be able to update the one field then I'll open the database automatically and it will be running tasks based on this updated field.

This is how I have it started:

Set objConnection = CreateObject("ADODB.Connection")
objConnection.Open "Provider=Microsoft.ACE.OLEDB.14.0;Data Source=C:\DB\DB.accdb"

All I can get is "Error: Provider cannot be found. It may not be properly installed.

Code: 800A0E7A
Source: ADODB.Connection"

I can't seem to figure this out from all the googling I've done thus far and its driving me nuts!! it seems so simple! :banghead:

Thanks!!
 
Try . . .
Code:
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\DB\DB.accdb
 
Try . . .
Code:
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\DB\DB.accdb

I had it with the 12.0 but tried 14 as well for sh*ts and giggles really.
 
What about . . .
Code:
Provider=Microsoft.Jet.OLEDB.4.0
 
From what application are you trying to connect to an Access 2010 DB?

David
 
I'm attempting to use a vbscript file called from a microsoft scheduled task to update a table with an ID #.

The Scheduled Task calls the .vbs file.
The .vbs file updates the table with the ID # of some tasks that will be run.
The .vbs file then calls the opening of the .accdb file with a form that loads, looks at the newly updated table and runs the tasks associated with that ID #.

Hopefully that makes sense. if there is an easier way, I'd do that but I'm not sure how to do that.
 
I've worked with scheduled tasks before that have opened an Access database, but not with a task that calls a .vbs file.
Where does the value(s) of "ID # of some tasks that will be run" come from?
There may be another way to do this

David
 
That comes from part of the application. I have one interface that allows the user to select their schedule for creating the scheduled task. During the process, they are able to pick some tasks that will be run (refreshing customer info, etc.) These tasks are related to a "master job" which is the ID #. So Task ID 1 would have jobs associated with it (like updating customer info which comes from a separate database) that would run on the scheduled time frame (every night, every week, etc).

I am using the VBS file to update the program so it knows which "master job" to run next time it opens.
 
I know that there are issues with ADODB as you are supposed to use ADO.NET. Can you let see the script to the objConnection.Open.

Simon
 

Users who are viewing this thread

Back
Top Bottom