help with ADODB error ONLY when running script as scheduled task?

By ·
Has anyone run into this problem? it is driving me nuts!

The following pertains to a Window7 - 64bit Dell T7500:

I have a vbscript that loads data from a csv into an msaccess 97 DB.
The script is called from a bat, works JUST FINE when I manually run the bat file from command prompt (C:\Windows\System32\cmd.exe) in non-'runasadministrator' mode AND in 'runasadministrator' mode. (Note that the shortcut to open this command prompt exists as a button on the Microsoft Office Shortcut Bar.)

BUT, when I try to run the bat as a scheduled task, or when launching from a command prompt opened via Start - All Programs - Accessories - Command Prompt (%windir%\system32\cmd.exe - and %windir% translates to "C:\Windows") I get the following error:

DB.vbs(13, 1) ADODB.Connection: Provider cannot be found. It may not be properly installed.

Since I get the same results running from the command prompt described above, I wont bother including the specifics of the scheduled task. I imagine once the regular command line is solved - the scheduled task will be also.

Below are the first 18 lines of the script - conveniently numbered (accurate at least thru 13).

If anyone knows whats wrong or how to fix this I would be very appreciative. Right now I'm reduced to scheduling a pop-up to run every 2 hours that reminds me to manually run the script.


1. Const adOpenStatic = 3
2. Const adLockOptimistic = 3
3. Const ForReading = 1
5. strHeader = "Object Name,Poll Time,Owner Array Name,Current Owner,Utilization (%),Utilization-Optimal (%),Utilization-Nonoptimal (%),Queue Length,Queue Length-Optimal,Queue Length-Nonoptimal,Response Time (ms),Response Time-Optimal (ms),Response Time-Nonoptimal (ms),Total Bandwidth (MB/s),Total Bandwidth-Optimal (MB/s),Total Bandwidth-Nonoptimal (MB/s),Total Throughput (IO/s),Total Throughput-Optimal (IO/s),Total Throughput-Nonoptimal (IO/s),Read Bandwidth (MB/s),Read Bandwidth-Optimal (MB/s),Read Bandwidth-Nonoptimal (MB/s),Read Size (KB),Read Size-Optimal (KB),Read Size-Nonoptimal (KB),Read Throughput (IO/s),Read Throughput-Optimal (IO/s),Read Throughput-Nonoptimal (IO/s),Write Bandwidth (MB/s),Write Bandwidth-Optimal (MB/s),Write Bandwidth-Nonoptimal (MB/s),Write Size (KB),Write Size-Optimal (KB),Write Size-Nonoptimal (KB),Write Throughput (IO/s),Write Throughput-Optimal (IO/s),Write Throughput-Nonoptimal (IO/s),Full Stripe Writes/s,Prefetch Bandwidth (MB/s),Used Prefetches (%),Read Cache Hits/s,Read Cache Misses/s,Reads From Write Cache/s,Reads From Read Cache/s,Read Cache Hit Ratio,Write Cache Hits/s,Write Cache Misses/s,Write Cache Rehits/s,Write Cache Hit Ratio,Write Cache Rehit Ratio,Forced Flushes/s,Disk Crossings (%),Average Busy Queue Length,Average Busy Queue Length-Optimal,Average Busy Queue Length-Nonoptimal,Disk Crossings/s,Service Time (ms),Service Time-Optimal (ms),Service Time-Nonoptimal (ms),LUN Read Crossings/s,LUN Write Crossings/s,Average Seek Distance (GB),Dirty Pages (%),Flush Ratio,MBs Flushed (MB/s),High Water Flush On,Idle Flush On,Low Water Flush Off,Write Cache Flushes/s,Reads From Snapshot Cache,Reads From Snapshot Copy LUN,Reads From Snapshot Source LUN,Writes To Snapshot Source LUN,Writes To Snapshot Cache,Writes Larger Than Snapshot Cache Chunk Size,Chunks Used In SnapShot Copy Session,Read 512B,Read 1KB,Read 2KB,Read 4KB,Read 8KB,Read 16KB,Read 32KB,Read 64KB,Read 128KB,Read 256KB,Read 512KB,Write 512B,Write 1KB,Write 2KB,Write 4KB,Write 8KB,Write 16KB,Write 32KB,Write 64KB,Write 128KB,Write 256KB,Write 512KB,Total 512B,Total 1KB,Total 2KB,Total 4KB,Total 8KB,Total 16KB,Total 32KB,Total 64KB,Total 128KB,Total 256KB,Total 512KB,Average Transfer Size (KB),Time Lag (min),Data Lag (MB),Queue Full Count,Cycle Count,Average Cycle Time (min),Explicit Trespass Count,Explicit Trespass Count-Optimal,Explicit Trespass Count-Nonoptimal,Implicit Trespass Count,Implicit Trespass Count-Optimal,Implicit Trespass Count-Nonoptimal"
7. arrHeader = Split(strHeader, ",")
10. Set objConnection = CreateObject("ADODB.Connection")
11. Set objRecordSet = CreateObject("ADODB.Recordset")
13. objConnection.Open _
14. "Provider = Microsoft.Jet.OLEDB.4.0; " & _
15. "Data Source = C:\K App Files\EMCstats\san.mdb"
17. objRecordSet.Open "SELECT * FROM SANStats", _
18. objConnection, adOpenStatic, adLockOptimistic

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Share your knowledge
Back to Software Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums