Update Access Database from VBScript (1 Viewer)

mikebrewer

Registered User.
Local time
Today, 12:36
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!!
 

MarkK

bit cruncher
Local time
Today, 09:36
Joined
Mar 17, 2004
Messages
8,181
Try . . .
Code:
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\DB\DB.accdb
 

mikebrewer

Registered User.
Local time
Today, 12:36
Joined
Sep 28, 2011
Messages
93
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.
 

MarkK

bit cruncher
Local time
Today, 09:36
Joined
Mar 17, 2004
Messages
8,181
What about . . .
Code:
Provider=Microsoft.Jet.OLEDB.4.0
 

DavidAtWork

Registered User.
Local time
Today, 17:36
Joined
Oct 25, 2011
Messages
699
From what application are you trying to connect to an Access 2010 DB?

David
 

mikebrewer

Registered User.
Local time
Today, 12:36
Joined
Sep 28, 2011
Messages
93
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.
 

DavidAtWork

Registered User.
Local time
Today, 17:36
Joined
Oct 25, 2011
Messages
699
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
 

mikebrewer

Registered User.
Local time
Today, 12:36
Joined
Sep 28, 2011
Messages
93
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.
 

Simon_MT

Registered User.
Local time
Today, 17:36
Joined
Feb 26, 2007
Messages
2,177
Are you running at intranet using IIS?

Simon
 

Simon_MT

Registered User.
Local time
Today, 17:36
Joined
Feb 26, 2007
Messages
2,177
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

Top Bottom