VBS - Provider cannot be found. It may not me properly installed.

L

LenJr

I have Access 2007 installed on my machine and I am trying to use the
following to connect to a delimeted text file using a VB script:
objConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & strPathName & ";" & _
"Extended Properties=""text;HDR=YES;FMT=Delimited'"""
This use to work for me when I was running Access 2003. I am getting the
following error message:
Error: Provider cannot be found. It may not me properly installed.
code: 800A0E7A
source: ADODB.Connection

I read something about the Access 2007 running with 64 bit may cause an
issue with this.....but is there
someway to get around this?

Thanks.
 
D

Douglas J. Steele

Try replacing

Microsoft.Jet.OLEDB.4.0;

with

Microsoft.ACE.OLEDB.12.0;
 
D

Douglas J. Steele

You would appear to have a single quote after FMT=Delimited. All you should
have is the three double quotes.
 
L

LenJr

Still having the issue:

Set objConnection = CreateObject("ADODB.Connection")

objConnection.Open "Provider=Microsoft.ACE.OLEDB.12.0;" & _
"Data Source=" & strPathName & ";" & _
"Extended Properties=""text;HDR=YES;FMT=Delimited"""
 
D

Douglas J. Steele

Afraid I'm running out of ideas.

Can you create a linked table pointing to that text file, or import it into
Access? If not, you may have to reinstall Access.
 
L

LenJr

I am running a script that dynamically runs through a folding reading all txt
files and writing the records I want to 1 csv file. I had this working at a
different shop...just changed jobs and trying to run the same logic and it is
not working.....I do have Access 2003 and 2007 on this machine.
 
D

Douglas J. Steele

The point of my question was simply to see whether the Text IISAM was
properly installed when you installed Access 2007.

If you can't link using Access, then it's not surprising your script doesn't
work.

If you can link using Access, then something else is causing the problem.
 
L

LenJr

Sorry about that. Yes...using Access 2007 and Access 2003 I am able to link
to a text file.
 
D

Douglas J. Steele

The only other suggestion I have, I'm afraid, is to try putting a semi-colon
at the end of the string (and ensure that strPathName ends in a slash)

objConnection.Open "Provider=Microsoft.ACE.OLEDB.12.0;" & _
"Data Source=" & strPathName & ";" & _
"Extended Properties=""text;HDR=YES;FMT=Delimited"";"
 
L

LenJr

Thanks for your help....but still not working. I tried my code on a
different PC that just has Office 2007 loaded and it works....so it is
something on my PC......
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top