PC Review


Reply
Thread Tools Rate Thread

ADO connection Open failure

 
 
=?Utf-8?B?YWxleGhhdHppc2F2YXM=?=
Guest
Posts: n/a
 
      25th Sep 2007

Hi all.

I've run into an ADO issue, here's what's happening:


I'm using an Excel file on a shared drive to automate an Access database in
the background.

At some point in the code I'm using ADO to export an Access dataset.

The problem occurs when the code attempts to open an ADO connection.

Please note that this is most likely a compatibility issue; I get no errors
when I run the code from my PC.

** The error occured when another user tried to execute the code. **


Here's the VBA in question:

Dim strCon As String
Dim con As ADODB.Connection
Dim rst As ADODB.Recordset

Set con = New ADODB.Connection

strCon = "Provider=Microsoft.Jet.OLEDB.4.0; " _
& "Data Source=" & strAppAccFullName & ";"

con.Open ConnectionString:=strCon

The strAppAccFullName string variable is used for the full path name to the
Access database on the shared drive; its value is:

"\\Seukefnpcrw001\DB_ZM33_review_v1.3.mdb"


The error message I'm getting is:

Run-time error '-2147220999 (800401f9):

Method 'Open' of object '_Connection' failed


As for the settings etc.:

The Excel file is using the following references:

- Visual Basic for Applications
- Microsoft Excel 11.0 Object Library
- OLE Automation
- Microsoft Office 11.0 Object Library
- Microsoft Forms 2.0 Object Library
- Microsoft Access 11.0 Object Library
- Microsoft DAO 3.6 Object Library
- Microsoft ActiveX Data Objects 2.8 Library

On my PC (where the code runs fine), I'm running Office 2003 & Windows XP.
My MDAC version is 2.81.

On the PC where the error occurred, the user is running Office 2002 &
Windows XP.
The MDAC version on that PC must be 2.8xx, because I tried to install MDAC
2.8 from Microsoft and the installation failed (I was told the component is a
part of Windows).


The objective is to get the code to run without errors on the other user's
PC (Office 2002).


Any insights / suggestions would be greatly appreciated.

Many thanks,
Alex


 
Reply With Quote
 
 
 
 
Norman Yuan
Guest
Posts: n/a
 
      25th Sep 2007
Does the user account that runs your code has read & write permission to the
network folder ("\\Seukefnpcrw001\DB_ZM33_review_v1.3.mdb")? To connect to
Jet database, the user must have read/write permission to the folder where
*.mdb is in.

Also, you do not need to set reference to DAO3.6, since you are using ADO.
That is, either use ADO, or use DAO, not both.


"alexhatzisavas" <(E-Mail Removed)> wrote in message
news:8047B471-9065-492C-AA89-(E-Mail Removed)...
>
> Hi all.
>
> I've run into an ADO issue, here's what's happening:
>
>
> I'm using an Excel file on a shared drive to automate an Access database
> in
> the background.
>
> At some point in the code I'm using ADO to export an Access dataset.
>
> The problem occurs when the code attempts to open an ADO connection.
>
> Please note that this is most likely a compatibility issue; I get no
> errors
> when I run the code from my PC.
>
> ** The error occured when another user tried to execute the code. **
>
>
> Here's the VBA in question:
>
> Dim strCon As String
> Dim con As ADODB.Connection
> Dim rst As ADODB.Recordset
>
> Set con = New ADODB.Connection
>
> strCon = "Provider=Microsoft.Jet.OLEDB.4.0; " _
> & "Data Source=" & strAppAccFullName & ";"
>
> con.Open ConnectionString:=strCon
>
> The strAppAccFullName string variable is used for the full path name to
> the
> Access database on the shared drive; its value is:
>
> "\\Seukefnpcrw001\DB_ZM33_review_v1.3.mdb"
>
>
> The error message I'm getting is:
>
> Run-time error '-2147220999 (800401f9):
>
> Method 'Open' of object '_Connection' failed
>
>
> As for the settings etc.:
>
> The Excel file is using the following references:
>
> - Visual Basic for Applications
> - Microsoft Excel 11.0 Object Library
> - OLE Automation
> - Microsoft Office 11.0 Object Library
> - Microsoft Forms 2.0 Object Library
> - Microsoft Access 11.0 Object Library
> - Microsoft DAO 3.6 Object Library
> - Microsoft ActiveX Data Objects 2.8 Library
>
> On my PC (where the code runs fine), I'm running Office 2003 & Windows
> XP.
> My MDAC version is 2.81.
>
> On the PC where the error occurred, the user is running Office 2002 &
> Windows XP.
> The MDAC version on that PC must be 2.8xx, because I tried to install MDAC
> 2.8 from Microsoft and the installation failed (I was told the component
> is a
> part of Windows).
>
>
> The objective is to get the code to run without errors on the other user's
> PC (Office 2002).
>
>
> Any insights / suggestions would be greatly appreciated.
>
> Many thanks,
> Alex
>
>


 
Reply With Quote
 
Norman Yuan
Guest
Posts: n/a
 
      25th Sep 2007
Does the user account that runs your code has read & write permission to the
network folder ("\\Seukefnpcrw001\DB_ZM33_review_v1.3.mdb")? To connect to
Jet database, the user must have read/write permission to the folder where
*.mdb is in.

Also, you do not need to set reference to DAO3.6, since you are using ADO.
That is, either use ADO, or use DAO, not both.



"alexhatzisavas" <(E-Mail Removed)> wrote in message
news:8047B471-9065-492C-AA89-(E-Mail Removed)...
>
> Hi all.
>
> I've run into an ADO issue, here's what's happening:
>
>
> I'm using an Excel file on a shared drive to automate an Access database
> in
> the background.
>
> At some point in the code I'm using ADO to export an Access dataset.
>
> The problem occurs when the code attempts to open an ADO connection.
>
> Please note that this is most likely a compatibility issue; I get no
> errors
> when I run the code from my PC.
>
> ** The error occured when another user tried to execute the code. **
>
>
> Here's the VBA in question:
>
> Dim strCon As String
> Dim con As ADODB.Connection
> Dim rst As ADODB.Recordset
>
> Set con = New ADODB.Connection
>
> strCon = "Provider=Microsoft.Jet.OLEDB.4.0; " _
> & "Data Source=" & strAppAccFullName & ";"
>
> con.Open ConnectionString:=strCon
>
> The strAppAccFullName string variable is used for the full path name to
> the
> Access database on the shared drive; its value is:
>
> "\\Seukefnpcrw001\DB_ZM33_review_v1.3.mdb"
>
>
> The error message I'm getting is:
>
> Run-time error '-2147220999 (800401f9):
>
> Method 'Open' of object '_Connection' failed
>
>
> As for the settings etc.:
>
> The Excel file is using the following references:
>
> - Visual Basic for Applications
> - Microsoft Excel 11.0 Object Library
> - OLE Automation
> - Microsoft Office 11.0 Object Library
> - Microsoft Forms 2.0 Object Library
> - Microsoft Access 11.0 Object Library
> - Microsoft DAO 3.6 Object Library
> - Microsoft ActiveX Data Objects 2.8 Library
>
> On my PC (where the code runs fine), I'm running Office 2003 & Windows
> XP.
> My MDAC version is 2.81.
>
> On the PC where the error occurred, the user is running Office 2002 &
> Windows XP.
> The MDAC version on that PC must be 2.8xx, because I tried to install MDAC
> 2.8 from Microsoft and the installation failed (I was told the component
> is a
> part of Windows).
>
>
> The objective is to get the code to run without errors on the other user's
> PC (Office 2002).
>
>
> Any insights / suggestions would be greatly appreciated.
>
> Many thanks,
> Alex
>
>


 
Reply With Quote
 
=?Utf-8?B?YWxleGhhdHppc2F2YXM=?=
Guest
Posts: n/a
 
      26th Sep 2007

"Norman Yuan" wrote:

> Does the user account that runs your code has read & write permission to the
> network folder ("\\Seukefnpcrw001\DB_ZM33_review_v1.3.mdb")? To connect to
> Jet database, the user must have read/write permission to the folder where
> *.mdb is in.


Thanks Norman.

Yes, the user has read/write permission to the shared drive.
A series of Access queries are executed without problems, and the code only
crashes when it reaches the point where ADO is used.



> Also, you do not need to set reference to DAO3.6, since you are using ADO.
> That is, either use ADO, or use DAO, not both.



I'm using DAO for some Access manipulatins (e.g. browsing through the
TableDefs collection).
The code has been executing fine on other PCs, so I don't think the issue is
related to this. Besides, what's the point of having these libraries if you
can't use combinations of them at the same time?


I'm leaning toward a corrupted MDAC, as per the following resource:
http://www.dbforums.com/archive/index.php/t-321180.html

I should also note that the user's PC has AS400 Client Access installed.

Any ideas?



"Norman Yuan" wrote:

> Does the user account that runs your code has read & write permission to the
> network folder ("\\Seukefnpcrw001\DB_ZM33_review_v1.3.mdb")? To connect to
> Jet database, the user must have read/write permission to the folder where
> *.mdb is in.
>
> Also, you do not need to set reference to DAO3.6, since you are using ADO.
> That is, either use ADO, or use DAO, not both.
>
>
>
> "alexhatzisavas" <(E-Mail Removed)> wrote in message
> news:8047B471-9065-492C-AA89-(E-Mail Removed)...
> >
> > Hi all.
> >
> > I've run into an ADO issue, here's what's happening:
> >
> >
> > I'm using an Excel file on a shared drive to automate an Access database
> > in
> > the background.
> >
> > At some point in the code I'm using ADO to export an Access dataset.
> >
> > The problem occurs when the code attempts to open an ADO connection.
> >
> > Please note that this is most likely a compatibility issue; I get no
> > errors
> > when I run the code from my PC.
> >
> > ** The error occured when another user tried to execute the code. **
> >
> >
> > Here's the VBA in question:
> >
> > Dim strCon As String
> > Dim con As ADODB.Connection
> > Dim rst As ADODB.Recordset
> >
> > Set con = New ADODB.Connection
> >
> > strCon = "Provider=Microsoft.Jet.OLEDB.4.0; " _
> > & "Data Source=" & strAppAccFullName & ";"
> >
> > con.Open ConnectionString:=strCon
> >
> > The strAppAccFullName string variable is used for the full path name to
> > the
> > Access database on the shared drive; its value is:
> >
> > "\\Seukefnpcrw001\DB_ZM33_review_v1.3.mdb"
> >
> >
> > The error message I'm getting is:
> >
> > Run-time error '-2147220999 (800401f9):
> >
> > Method 'Open' of object '_Connection' failed
> >
> >
> > As for the settings etc.:
> >
> > The Excel file is using the following references:
> >
> > - Visual Basic for Applications
> > - Microsoft Excel 11.0 Object Library
> > - OLE Automation
> > - Microsoft Office 11.0 Object Library
> > - Microsoft Forms 2.0 Object Library
> > - Microsoft Access 11.0 Object Library
> > - Microsoft DAO 3.6 Object Library
> > - Microsoft ActiveX Data Objects 2.8 Library
> >
> > On my PC (where the code runs fine), I'm running Office 2003 & Windows
> > XP.
> > My MDAC version is 2.81.
> >
> > On the PC where the error occurred, the user is running Office 2002 &
> > Windows XP.
> > The MDAC version on that PC must be 2.8xx, because I tried to install MDAC
> > 2.8 from Microsoft and the installation failed (I was told the component
> > is a
> > part of Windows).
> >
> >
> > The objective is to get the code to run without errors on the other user's
> > PC (Office 2002).
> >
> >
> > Any insights / suggestions would be greatly appreciated.
> >
> > Many thanks,
> > Alex
> >
> >

>
>

 
Reply With Quote
 
Norman Yuan
Guest
Posts: n/a
 
      26th Sep 2007
Since you use DAO, have you tried to use DAO to open the database/a
RecordSet? If the code is to only work with JET database (*.mdb) and since
DAO is needed for schema data manipulating, I'd also use DAO for data
accessing. DAO is better than ADO when dealing with JET database. This at
least eliminates a possible error source (ADO).


"alexhatzisavas" <(E-Mail Removed)> wrote in message
news:3F66AA6C-61C5-4F5D-968F-(E-Mail Removed)...
>
> "Norman Yuan" wrote:
>
>> Does the user account that runs your code has read & write permission to
>> the
>> network folder ("\\Seukefnpcrw001\DB_ZM33_review_v1.3.mdb")? To connect
>> to
>> Jet database, the user must have read/write permission to the folder
>> where
>> *.mdb is in.

>
> Thanks Norman.
>
> Yes, the user has read/write permission to the shared drive.
> A series of Access queries are executed without problems, and the code
> only
> crashes when it reaches the point where ADO is used.
>
>
>
>> Also, you do not need to set reference to DAO3.6, since you are using
>> ADO.
>> That is, either use ADO, or use DAO, not both.

>
>
> I'm using DAO for some Access manipulatins (e.g. browsing through the
> TableDefs collection).
> The code has been executing fine on other PCs, so I don't think the issue
> is
> related to this. Besides, what's the point of having these libraries if
> you
> can't use combinations of them at the same time?
>
>
> I'm leaning toward a corrupted MDAC, as per the following resource:
> http://www.dbforums.com/archive/index.php/t-321180.html
>
> I should also note that the user's PC has AS400 Client Access installed.
>
> Any ideas?
>
>
>
> "Norman Yuan" wrote:
>
>> Does the user account that runs your code has read & write permission to
>> the
>> network folder ("\\Seukefnpcrw001\DB_ZM33_review_v1.3.mdb")? To connect
>> to
>> Jet database, the user must have read/write permission to the folder
>> where
>> *.mdb is in.
>>
>> Also, you do not need to set reference to DAO3.6, since you are using
>> ADO.
>> That is, either use ADO, or use DAO, not both.
>>
>>
>>
>> "alexhatzisavas" <(E-Mail Removed)> wrote in
>> message
>> news:8047B471-9065-492C-AA89-(E-Mail Removed)...
>> >
>> > Hi all.
>> >
>> > I've run into an ADO issue, here's what's happening:
>> >
>> >
>> > I'm using an Excel file on a shared drive to automate an Access
>> > database
>> > in
>> > the background.
>> >
>> > At some point in the code I'm using ADO to export an Access dataset.
>> >
>> > The problem occurs when the code attempts to open an ADO connection.
>> >
>> > Please note that this is most likely a compatibility issue; I get no
>> > errors
>> > when I run the code from my PC.
>> >
>> > ** The error occured when another user tried to execute the code. **
>> >
>> >
>> > Here's the VBA in question:
>> >
>> > Dim strCon As String
>> > Dim con As ADODB.Connection
>> > Dim rst As ADODB.Recordset
>> >
>> > Set con = New ADODB.Connection
>> >
>> > strCon = "Provider=Microsoft.Jet.OLEDB.4.0; " _
>> > & "Data Source=" & strAppAccFullName & ";"
>> >
>> > con.Open ConnectionString:=strCon
>> >
>> > The strAppAccFullName string variable is used for the full path name to
>> > the
>> > Access database on the shared drive; its value is:
>> >
>> > "\\Seukefnpcrw001\DB_ZM33_review_v1.3.mdb"
>> >
>> >
>> > The error message I'm getting is:
>> >
>> > Run-time error '-2147220999 (800401f9):
>> >
>> > Method 'Open' of object '_Connection' failed
>> >
>> >
>> > As for the settings etc.:
>> >
>> > The Excel file is using the following references:
>> >
>> > - Visual Basic for Applications
>> > - Microsoft Excel 11.0 Object Library
>> > - OLE Automation
>> > - Microsoft Office 11.0 Object Library
>> > - Microsoft Forms 2.0 Object Library
>> > - Microsoft Access 11.0 Object Library
>> > - Microsoft DAO 3.6 Object Library
>> > - Microsoft ActiveX Data Objects 2.8 Library
>> >
>> > On my PC (where the code runs fine), I'm running Office 2003 & Windows
>> > XP.
>> > My MDAC version is 2.81.
>> >
>> > On the PC where the error occurred, the user is running Office 2002 &
>> > Windows XP.
>> > The MDAC version on that PC must be 2.8xx, because I tried to install
>> > MDAC
>> > 2.8 from Microsoft and the installation failed (I was told the
>> > component
>> > is a
>> > part of Windows).
>> >
>> >
>> > The objective is to get the code to run without errors on the other
>> > user's
>> > PC (Office 2002).
>> >
>> >
>> > Any insights / suggestions would be greatly appreciated.
>> >
>> > Many thanks,
>> > Alex
>> >
>> >

>>
>>


 
Reply With Quote
 
=?Utf-8?B?YWxleGhhdHppc2F2YXM=?=
Guest
Posts: n/a
 
      27th Sep 2007

"Norman Yuan" wrote:

> Since you use DAO, have you tried to use DAO to open the database/a
> RecordSet? If the code is to only work with JET database (*.mdb) and since
> DAO is needed for schema data manipulating, I'd also use DAO for data
> accessing. DAO is better than ADO when dealing with JET database. This at
> least eliminates a possible error source (ADO).



The thing is, I'm using ADO from Excel to connect to the database, retrieve
a dataset and 'paste' it onto a spreadhseet using the CopyFromRecordset
method.

The error occurred on the other user's PC when the code tries to establish
the ADO connection to the database:

Set con = New ADODB.Connection

strCon = "Provider=Microsoft.Jet.OLEDB.4.0; " _
& "Data Source=" & strAppAccFullName & ";"

con.Open ConnectionString:=strCon <<<- error

I wouldn't know how to do the same (i.e. 'paste' an Access dataset onto a
spreadsheet) using DAO from within Access.

If you think that's worth exploring and you've got some sample code for this
please feel free to paste it here.

Thanks again.



"Norman Yuan" wrote:

> Since you use DAO, have you tried to use DAO to open the database/a
> RecordSet? If the code is to only work with JET database (*.mdb) and since
> DAO is needed for schema data manipulating, I'd also use DAO for data
> accessing. DAO is better than ADO when dealing with JET database. This at
> least eliminates a possible error source (ADO).
>
>
> "alexhatzisavas" <(E-Mail Removed)> wrote in message
> news:3F66AA6C-61C5-4F5D-968F-(E-Mail Removed)...
> >
> > "Norman Yuan" wrote:
> >
> >> Does the user account that runs your code has read & write permission to
> >> the
> >> network folder ("\\Seukefnpcrw001\DB_ZM33_review_v1.3.mdb")? To connect
> >> to
> >> Jet database, the user must have read/write permission to the folder
> >> where
> >> *.mdb is in.

> >
> > Thanks Norman.
> >
> > Yes, the user has read/write permission to the shared drive.
> > A series of Access queries are executed without problems, and the code
> > only
> > crashes when it reaches the point where ADO is used.
> >
> >
> >
> >> Also, you do not need to set reference to DAO3.6, since you are using
> >> ADO.
> >> That is, either use ADO, or use DAO, not both.

> >
> >
> > I'm using DAO for some Access manipulatins (e.g. browsing through the
> > TableDefs collection).
> > The code has been executing fine on other PCs, so I don't think the issue
> > is
> > related to this. Besides, what's the point of having these libraries if
> > you
> > can't use combinations of them at the same time?
> >
> >
> > I'm leaning toward a corrupted MDAC, as per the following resource:
> > http://www.dbforums.com/archive/index.php/t-321180.html
> >
> > I should also note that the user's PC has AS400 Client Access installed.
> >
> > Any ideas?
> >
> >
> >
> > "Norman Yuan" wrote:
> >
> >> Does the user account that runs your code has read & write permission to
> >> the
> >> network folder ("\\Seukefnpcrw001\DB_ZM33_review_v1.3.mdb")? To connect
> >> to
> >> Jet database, the user must have read/write permission to the folder
> >> where
> >> *.mdb is in.
> >>
> >> Also, you do not need to set reference to DAO3.6, since you are using
> >> ADO.
> >> That is, either use ADO, or use DAO, not both.
> >>
> >>
> >>
> >> "alexhatzisavas" <(E-Mail Removed)> wrote in
> >> message
> >> news:8047B471-9065-492C-AA89-(E-Mail Removed)...
> >> >
> >> > Hi all.
> >> >
> >> > I've run into an ADO issue, here's what's happening:
> >> >
> >> >
> >> > I'm using an Excel file on a shared drive to automate an Access
> >> > database
> >> > in
> >> > the background.
> >> >
> >> > At some point in the code I'm using ADO to export an Access dataset.
> >> >
> >> > The problem occurs when the code attempts to open an ADO connection.
> >> >
> >> > Please note that this is most likely a compatibility issue; I get no
> >> > errors
> >> > when I run the code from my PC.
> >> >
> >> > ** The error occured when another user tried to execute the code. **
> >> >
> >> >
> >> > Here's the VBA in question:
> >> >
> >> > Dim strCon As String
> >> > Dim con As ADODB.Connection
> >> > Dim rst As ADODB.Recordset
> >> >
> >> > Set con = New ADODB.Connection
> >> >
> >> > strCon = "Provider=Microsoft.Jet.OLEDB.4.0; " _
> >> > & "Data Source=" & strAppAccFullName & ";"
> >> >
> >> > con.Open ConnectionString:=strCon
> >> >
> >> > The strAppAccFullName string variable is used for the full path name to
> >> > the
> >> > Access database on the shared drive; its value is:
> >> >
> >> > "\\Seukefnpcrw001\DB_ZM33_review_v1.3.mdb"
> >> >
> >> >
> >> > The error message I'm getting is:
> >> >
> >> > Run-time error '-2147220999 (800401f9):
> >> >
> >> > Method 'Open' of object '_Connection' failed
> >> >
> >> >
> >> > As for the settings etc.:
> >> >
> >> > The Excel file is using the following references:
> >> >
> >> > - Visual Basic for Applications
> >> > - Microsoft Excel 11.0 Object Library
> >> > - OLE Automation
> >> > - Microsoft Office 11.0 Object Library
> >> > - Microsoft Forms 2.0 Object Library
> >> > - Microsoft Access 11.0 Object Library
> >> > - Microsoft DAO 3.6 Object Library
> >> > - Microsoft ActiveX Data Objects 2.8 Library
> >> >
> >> > On my PC (where the code runs fine), I'm running Office 2003 & Windows
> >> > XP.
> >> > My MDAC version is 2.81.
> >> >
> >> > On the PC where the error occurred, the user is running Office 2002 &
> >> > Windows XP.
> >> > The MDAC version on that PC must be 2.8xx, because I tried to install
> >> > MDAC
> >> > 2.8 from Microsoft and the installation failed (I was told the
> >> > component
> >> > is a
> >> > part of Windows).
> >> >
> >> >
> >> > The objective is to get the code to run without errors on the other
> >> > user's
> >> > PC (Office 2002).
> >> >
> >> >
> >> > Any insights / suggestions would be greatly appreciated.
> >> >
> >> > Many thanks,
> >> > Alex
> >> >
> >> >
> >>
> >>

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ExecuteReader requires an open and available Connection. The connection's current state is Open, Executing. fniles Microsoft VB .NET 7 18th Apr 2007 02:51 AM
ExecuteScalar requires an open and available Connection. The connection's current state is Open, Executing. hasmukh4u@gmail.com Microsoft ADO .NET 0 2nd Feb 2007 02:30 PM
Connection Options MSDN example failure, scope connect failure =?Utf-8?B?YW5kcmV3Y3c=?= Microsoft C# .NET 0 4th Oct 2006 05:19 PM
Connection to GC fails with Login Failure leading to account lockout whereas LDAP connection to same domain works Yogesh Patil Microsoft Windows 2000 Active Directory 0 20th Jul 2005 01:56 PM
open connection failure with jet engine. david Microsoft ASP .NET 1 17th Nov 2003 04:56 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:26 AM.