0

I have simple script:

Set oConn = CreateObject("ADODB.Connection")

fPath = "c:\temp"

oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & fPath & "\;Extended 
Properties='text;HDR=No;FMT=Delimited'"

if oConn.Errors.Count>0 then
   Wscript.Echo "Error!!!" & oConn.Errors(0).Description & " code: " & Conn.Errors(0).Number
End if

try to run on Windows 7 x64 Professional or Ultimate by means of command:

c:\Windows\SysWOW64\cscript.exe 1.vbs

it finishes with error:

error code 0x80040e21, Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.

Everything works pretty well if use C# or VB.NET to do the same things.

eglease
  • 2,445
  • 11
  • 18
  • 28

2 Answers2

0

fPath is meant to hold a string, so you must not use Set.

ADDED

It may be a good idea to edit (and format) your question.

Did you read this article about using 64 bit drivers?

Ekkehard.Horner
  • 38,498
  • 2
  • 45
  • 96
0

You can run your script in 32bit modus on a 64bit box, then you probably won't have the error, see my answer here to check in which modus you are running and restart your script in the 32bit modus if necessary.

cscript.exe opens a window

Community
  • 1
  • 1
peter
  • 41,770
  • 5
  • 64
  • 108