dbEngine(0)(0) is the wrong file 
Author Message
 dbEngine(0)(0) is the wrong file

Under what circumstances can dbEngine(0)(0) refer to a file other than
Currentdb()?

This must be either a corrupted mdb, or a serious Access bug.

Opening a DAO recordset failed with error 3078:
    The Microsoft Jet database engine cannot find the input table
    or query 'tblImport'.  Make sure it exists and that its name is
    spelled correctly.
The table name was correct, so I tried to confirm where I was. Results:

? CurrentDb().Name
C:\WINNT\Temp\user\LoadIT.mdb
? dbEngine(0)(0).Name
C:\Documents and Settings\Administrator\Application
Data\Microsoft\Access\ACWZUSRT.MDT

Immediately before this, I had turned off Name AutoCorrect, and compacted.

Earlier I had run an import wizard to create an import spec. No other
wizards used.

This is Access 2002 SP2, using an Access 2000 file format.
No libraries referenced other than: VBA, Access 10, and DAO 3.6.
MZTools active.

The actual code (simplified) was
    Set db = DBEngine(0)(0)
    'API call for user to select file to import.
    DoCmd.TransferText acImportDelim, "MySpec", "tblImport", strFile
    strSQL = "SELECT * FROM tblImport ORDER BY ImportID;"
    Set rs = db.OpenRecordset(strSQL)

Anyone else experienced this, or know the cause?

--
Allen Browne - Microsoft MVP (Most Valuable Professional)
Allen Browne's Database And Training - Perth, Western Australia.
Tips for MS Access users - http://www.*-*-*.com/
Reply to the newsgroup. (Email address has spurious "_SpamTrap")



Sun, 31 Jul 2005 13:04:30 GMT  
 dbEngine(0)(0) is the wrong file
It is not a bug. And it is entirely possible. This is one of the
reasons I have tried to dissuade Lyle from always using DBEngine(0)(0)
in the past.

--
MichKa [MS]

This posting is provided "AS IS" with
no warranties, and confers no rights.


Quote:
> Under what circumstances can dbEngine(0)(0) refer to a file other
than
> Currentdb()?

> This must be either a corrupted mdb, or a serious Access bug.

> Opening a DAO recordset failed with error 3078:
>     The Microsoft Jet database engine cannot find the input table
>     or query 'tblImport'.  Make sure it exists and that its name is
>     spelled correctly.
> The table name was correct, so I tried to confirm where I was.
Results:

> ? CurrentDb().Name
> C:\WINNT\Temp\user\LoadIT.mdb
> ? dbEngine(0)(0).Name
> C:\Documents and Settings\Administrator\Application
> Data\Microsoft\Access\ACWZUSRT.MDT

> Immediately before this, I had turned off Name AutoCorrect, and
compacted.

> Earlier I had run an import wizard to create an import spec. No
other
> wizards used.

> This is Access 2002 SP2, using an Access 2000 file format.
> No libraries referenced other than: VBA, Access 10, and DAO 3.6.
> MZTools active.

> The actual code (simplified) was
>     Set db = DBEngine(0)(0)
>     'API call for user to select file to import.
>     DoCmd.TransferText acImportDelim, "MySpec", "tblImport", strFile
>     strSQL = "SELECT * FROM tblImport ORDER BY ImportID;"
>     Set rs = db.OpenRecordset(strSQL)

> Anyone else experienced this, or know the cause?

> --
> Allen Browne - Microsoft MVP (Most Valuable Professional)
> Allen Browne's Database And Training - Perth, Western Australia.
> Tips for MS Access users - http://allenbrowne.com/tips.html
> Reply to the newsgroup. (Email address has spurious "_SpamTrap")



Sun, 31 Jul 2005 13:40:57 GMT  
 dbEngine(0)(0) is the wrong file
On Wed, 12 Feb 2003 05:04:30 GMT, "Allen Browne"

Quote:

>Under what circumstances can dbEngine(0)(0) refer to a file other than
>Currentdb()?

>This must be either a corrupted mdb, or a serious Access bug.

>Opening a DAO recordset failed with error 3078:
>    The Microsoft Jet database engine cannot find the input table
>    or query 'tblImport'.  Make sure it exists and that its name is
>    spelled correctly.
>The table name was correct, so I tried to confirm where I was. Results:

>? CurrentDb().Name
>C:\WINNT\Temp\user\LoadIT.mdb
>? dbEngine(0)(0).Name
>C:\Documents and Settings\Administrator\Application
>Data\Microsoft\Access\ACWZUSRT.MDT
>...

On Tue, 11 Feb 2003 21:40:57 -0800, "Michael \(michka\) Kaplan [MS]"

Quote:

>It is not a bug. And it is entirely possible. This is one of the
>reasons I have tried to dissuade Lyle from always using DBEngine(0)(0)
>in the past.

I thought you had come out in favor of using DBEngine(0)(0) in some
cases.  Is it possible to give a brief summary of the circumstances
when it is and is not a good idea?

Thanks,

        Steve J.



Sun, 31 Jul 2005 13:49:35 GMT  
 dbEngine(0)(0) is the wrong file
Thanks, Michael.

Like Steve, I would be very interested to know the circumstances under which
this can occur.

I am willing to switch to CurrentDb() if I know a good reason for doing so.

--


Quote:
> It is not a bug. And it is entirely possible. This is one of the
> reasons I have tried to dissuade Lyle from always using DBEngine(0)(0)
> in the past.



> > Under what circumstances can dbEngine(0)(0) refer to a file other
> than
> > Currentdb()?

> > This must be either a corrupted mdb, or a serious Access bug.

> > Opening a DAO recordset failed with error 3078:
> >     The Microsoft Jet database engine cannot find the input table
> >     or query 'tblImport'.  Make sure it exists and that its name is
> >     spelled correctly.
> > The table name was correct, so I tried to confirm where I was.
> Results:

> > ? CurrentDb().Name
> > C:\WINNT\Temp\user\LoadIT.mdb
> > ? dbEngine(0)(0).Name
> > C:\Documents and Settings\Administrator\Application
> > Data\Microsoft\Access\ACWZUSRT.MDT

> > Immediately before this, I had turned off Name AutoCorrect, and
> compacted.

> > Earlier I had run an import wizard to create an import spec. No
> other
> > wizards used.

> > This is Access 2002 SP2, using an Access 2000 file format.
> > No libraries referenced other than: VBA, Access 10, and DAO 3.6.
> > MZTools active.

> > The actual code (simplified) was
> >     Set db = DBEngine(0)(0)
> >     'API call for user to select file to import.
> >     DoCmd.TransferText acImportDelim, "MySpec", "tblImport", strFile
> >     strSQL = "SELECT * FROM tblImport ORDER BY ImportID;"
> >     Set rs = db.OpenRecordset(strSQL)

> > Anyone else experienced this, or know the cause?



Sun, 31 Jul 2005 14:51:18 GMT  
 dbEngine(0)(0) is the wrong file


Quote:
> It is not a bug. And it is entirely possible. This is one of the
> reasons I have tried to dissuade Lyle from always using DBEngine(0)(0)
> in the past.

That was kind of you Michael. Did you mention this reason at the time?

It would be interesting if Allen would identify the line at which Current
Db and DbEngine(0)(0) became references to something else.

and

if DBEngine(0)(1) and CurrentDB pointed to the same db at the time of
error?

On reflection, I can't say that I'm surprised that some wizard db has to
assume the role of DBEngine(0)(0) in order to do some work on some other
db. I suppose the hand of wizards is in the glove of everything we do BUT,
I don't like wizards and never, or almost never, choose to use them
explicitly, (when I have a choice.)

and

I wonder if we checked every use of CurrentDB that had ever been made, we
could find some obscure problem with that

and lastly

is Allen's code not an indictment of CurrentDB rather than of DBEngine(0)
(0). Where is CurrentDB supposed to point?

--
Lyle



Sun, 31 Jul 2005 14:45:20 GMT  
 dbEngine(0)(0) is the wrong file
Lyle, CurrentDb().Name gave the correct reference. The file was from an
email attachment, so I really had saved it to the folder reported by
CurrentDb().

I did not attempt to read DBEngine(0)(1), and probably could not recreate
the error now.

--
Allen Browne - Microsoft MVP (Most Valuable Professional)
Allen Browne's Database And Training - Perth, Western Australia.
Tips for MS Access users - http://allenbrowne.com/tips.html
Reply to the newsgroup. (Email address has spurious "_SpamTrap")


Quote:


> > It is not a bug. And it is entirely possible. This is one of the
> > reasons I have tried to dissuade Lyle from always using DBEngine(0)(0)
> > in the past.

> That was kind of you Michael. Did you mention this reason at the time?

> It would be interesting if Allen would identify the line at which Current
> Db and DbEngine(0)(0) became references to something else.

> and

> if DBEngine(0)(1) and CurrentDB pointed to the same db at the time of
> error?

> On reflection, I can't say that I'm surprised that some wizard db has to
> assume the role of DBEngine(0)(0) in order to do some work on some other
> db. I suppose the hand of wizards is in the glove of everything we do BUT,
> I don't like wizards and never, or almost never, choose to use them
> explicitly, (when I have a choice.)

> and

> I wonder if we checked every use of CurrentDB that had ever been made, we
> could find some obscure problem with that

> and lastly

> is Allen's code not an indictment of CurrentDB rather than of DBEngine(0)
> (0). Where is CurrentDB supposed to point?

> --
> Lyle



Sun, 31 Jul 2005 15:58:17 GMT  
 dbEngine(0)(0) is the wrong file
On Feb 12 2003, 12:04 am, "Allen Browne"


Quote:
> Under what circumstances can dbEngine(0)(0) refer to a file other than
> Currentdb()?

> <snip problem description>

> Anyone else experienced this, or know the cause?

Hi Allen,

Yes, this is a known problem. Take a look at these search results:
http://groups.google.com/groups?&q=wzmain80.mde+group%3A*access*+auth...
imitri+author%3Afurman

--
(remove a 9 to reply by email)



Sun, 31 Jul 2005 20:37:32 GMT  
 dbEngine(0)(0) is the wrong file
At the time, I pointed out that is one combines running wizards,
compacting dbs, and continuing to run that one could run into
problems. I was asked about what kinds of problems and suggested the
DBEngine(0)(1) problem, which was widely scoffed at since they could
not repro such a thing. :-)

--
MichKa [MS]

This posting is provided "AS IS" with
no warranties, and confers no rights.


Quote:
> On Wed, 12 Feb 2003 05:04:30 GMT, "Allen Browne"

> >Under what circumstances can dbEngine(0)(0) refer to a file other
than
> >Currentdb()?

> >This must be either a corrupted mdb, or a serious Access bug.

> >Opening a DAO recordset failed with error 3078:
> >    The Microsoft Jet database engine cannot find the input table
> >    or query 'tblImport'.  Make sure it exists and that its name is
> >    spelled correctly.
> >The table name was correct, so I tried to confirm where I was.
Results:

> >? CurrentDb().Name
> >C:\WINNT\Temp\user\LoadIT.mdb
> >? dbEngine(0)(0).Name
> >C:\Documents and Settings\Administrator\Application
> >Data\Microsoft\Access\ACWZUSRT.MDT
> >...

> On Tue, 11 Feb 2003 21:40:57 -0800, "Michael \(michka\) Kaplan [MS]"

> >It is not a bug. And it is entirely possible. This is one of the
> >reasons I have tried to dissuade Lyle from always using
DBEngine(0)(0)
> >in the past.

> I thought you had come out in favor of using DBEngine(0)(0) in some
> cases.  Is it possible to give a brief summary of the circumstances
> when it is and is not a good idea?

> Thanks,

> Steve J.



Sun, 31 Jul 2005 21:06:31 GMT  
 dbEngine(0)(0) is the wrong file
Well, acwzdat and acwzusr are wizards *data* files which are
themselves opened via DAO. The reason to prefer CurrentDb is that
Access guarantees it to be the current database in Access, whereas
DBEngine(0)(0) does not have this guarantee.

In truth if you do not compact the db without shutting down Access and
restarting, it is not possible to his the problem, so its pretty easy
to make DBEngine(0)(0) safe.

--
MichKa [MS]

This posting is provided "AS IS" with
no warranties, and confers no rights.


Quote:
> Thanks, Michael.

> Like Steve, I would be very interested to know the circumstances
under which
> this can occur.

> I am willing to switch to CurrentDb() if I know a good reason for
doing so.

> --

in

> > It is not a bug. And it is entirely possible. This is one of the
> > reasons I have tried to dissuade Lyle from always using
DBEngine(0)(0)
> > in the past.



> > > Under what circumstances can dbEngine(0)(0) refer to a file
other
> > than
> > > Currentdb()?

> > > This must be either a corrupted mdb, or a serious Access bug.

> > > Opening a DAO recordset failed with error 3078:
> > >     The Microsoft Jet database engine cannot find the input
table
> > >     or query 'tblImport'.  Make sure it exists and that its name
is
> > >     spelled correctly.
> > > The table name was correct, so I tried to confirm where I was.
> > Results:

> > > ? CurrentDb().Name
> > > C:\WINNT\Temp\user\LoadIT.mdb
> > > ? dbEngine(0)(0).Name
> > > C:\Documents and Settings\Administrator\Application
> > > Data\Microsoft\Access\ACWZUSRT.MDT

> > > Immediately before this, I had turned off Name AutoCorrect, and
> > compacted.

> > > Earlier I had run an import wizard to create an import spec. No
> > other
> > > wizards used.

> > > This is Access 2002 SP2, using an Access 2000 file format.
> > > No libraries referenced other than: VBA, Access 10, and DAO 3.6.
> > > MZTools active.

> > > The actual code (simplified) was
> > >     Set db = DBEngine(0)(0)
> > >     'API call for user to select file to import.
> > >     DoCmd.TransferText acImportDelim, "MySpec", "tblImport",
strFile
> > >     strSQL = "SELECT * FROM tblImport ORDER BY ImportID;"
> > >     Set rs = db.OpenRecordset(strSQL)

> > > Anyone else experienced this, or know the cause?



Sun, 31 Jul 2005 21:11:15 GMT  
 dbEngine(0)(0) is the wrong file
Actually wizards never *try* to do such a thing. And I was not being
kind, I was being very matter of fact about things. I did mention
there were times that CurrentDb <> DBEngine(0)(0) but because I did
not give explicit steps, no one believed me.

--
MichKa [MS]

This posting is provided "AS IS" with
no warranties, and confers no rights.


Quote:

wrote in

> > It is not a bug. And it is entirely possible. This is one of the
> > reasons I have tried to dissuade Lyle from always using
DBEngine(0)(0)
> > in the past.

> That was kind of you Michael. Did you mention this reason at the
time?

> It would be interesting if Allen would identify the line at which
Current
> Db and DbEngine(0)(0) became references to something else.

> and

> if DBEngine(0)(1) and CurrentDB pointed to the same db at the time
of
> error?

> On reflection, I can't say that I'm surprised that some wizard db
has to
> assume the role of DBEngine(0)(0) in order to do some work on some
other
> db. I suppose the hand of wizards is in the glove of everything we
do BUT,
> I don't like wizards and never, or almost never, choose to use them
> explicitly, (when I have a choice.)

> and

> I wonder if we checked every use of CurrentDB that had ever been
made, we
> could find some obscure problem with that

> and lastly

> is Allen's code not an indictment of CurrentDB rather than of
DBEngine(0)
> (0). Where is CurrentDB supposed to point?

> --
> Lyle



Sun, 31 Jul 2005 21:08:11 GMT  
 dbEngine(0)(0) is the wrong file
Thanks, Michael. Your 2nd para. is exactly what I needed to know.

In that case, I reckon I'll keep using DbEngine(0)(0), and always restart
Access after a compact.

--
Allen Browne - Microsoft MVP (Most Valuable Professional)
Allen Browne's Database And Training - Perth, Western Australia.
Tips for MS Access users - http://allenbrowne.com/tips.html
Reply to the newsgroup. (Email address has spurious "_SpamTrap")



Quote:
> Well, acwzdat and acwzusr are wizards *data* files which are
> themselves opened via DAO. The reason to prefer CurrentDb is that
> Access guarantees it to be the current database in Access, whereas
> DBEngine(0)(0) does not have this guarantee.

> In truth if you do not compact the db without shutting down Access and
> restarting, it is not possible to his the problem, so its pretty easy
> to make DBEngine(0)(0) safe.

> --
> MichKa [MS]

> This posting is provided "AS IS" with
> no warranties, and confers no rights.



> > Thanks, Michael.

> > Like Steve, I would be very interested to know the circumstances
> under which
> > this can occur.

> > I am willing to switch to CurrentDb() if I know a good reason for
> doing so.

> > --

> in

> > > It is not a bug. And it is entirely possible. This is one of the
> > > reasons I have tried to dissuade Lyle from always using
> DBEngine(0)(0)
> > > in the past.



> > > > Under what circumstances can dbEngine(0)(0) refer to a file
> other
> > > than
> > > > Currentdb()?

> > > > This must be either a corrupted mdb, or a serious Access bug.

> > > > Opening a DAO recordset failed with error 3078:
> > > >     The Microsoft Jet database engine cannot find the input
> table
> > > >     or query 'tblImport'.  Make sure it exists and that its name
> is
> > > >     spelled correctly.
> > > > The table name was correct, so I tried to confirm where I was.
> > > Results:

> > > > ? CurrentDb().Name
> > > > C:\WINNT\Temp\user\LoadIT.mdb
> > > > ? dbEngine(0)(0).Name
> > > > C:\Documents and Settings\Administrator\Application
> > > > Data\Microsoft\Access\ACWZUSRT.MDT

> > > > Immediately before this, I had turned off Name AutoCorrect, and
> > > compacted.

> > > > Earlier I had run an import wizard to create an import spec. No
> > > other
> > > > wizards used.

> > > > This is Access 2002 SP2, using an Access 2000 file format.
> > > > No libraries referenced other than: VBA, Access 10, and DAO 3.6.
> > > > MZTools active.

> > > > The actual code (simplified) was
> > > >     Set db = DBEngine(0)(0)
> > > >     'API call for user to select file to import.
> > > >     DoCmd.TransferText acImportDelim, "MySpec", "tblImport",
> strFile
> > > >     strSQL = "SELECT * FROM tblImport ORDER BY ImportID;"
> > > >     Set rs = db.OpenRecordset(strSQL)

> > > > Anyone else experienced this, or know the cause?



Sun, 31 Jul 2005 21:28:18 GMT  
 dbEngine(0)(0) is the wrong file
Dimitri, thank you.

The threads in that link were informative.

--
Allen Browne - Microsoft MVP (Most Valuable Professional)
Allen Browne's Database And Training - Perth, Western Australia.
Tips for MS Access users - http://allenbrowne.com/tips.html
Reply to the newsgroup. (Email address has spurious "_SpamTrap")


Quote:
> On Feb 12 2003, 12:04 am, "Allen Browne"


> > Under what circumstances can dbEngine(0)(0) refer to a file other than
> > Currentdb()?

> > <snip problem description>

> > Anyone else experienced this, or know the cause?

> Hi Allen,

> Yes, this is a known problem. Take a look at these search results:

http://groups.google.com/groups?&q=wzmain80.mde+group%3A*access*+auth...

- Show quoted text -

Quote:
> imitri+author%3Afurman

> --
> (remove a 9 to reply by email)



Sun, 31 Jul 2005 21:29:14 GMT  
 dbEngine(0)(0) is the wrong file


Quote:
> At the time, I pointed out that is one combines running wizards,
> compacting dbs, and continuing to run that one could run into
> problems. I was asked about what kinds of problems and suggested the
> DBEngine(0)(1) problem, which was widely scoffed at since they could
> not repro such a thing. :-)

Everytime I run wizards, compact the db, and continue to run that one, I'll
use CurrentDb  ... promise.

--
Lyle



Sun, 31 Jul 2005 23:16:43 GMT  
 dbEngine(0)(0) is the wrong file


Quote:
>Like Steve, I would be very interested to know the circumstances
>under which this can occur.

>I am willing to switch to CurrentDb() if I know a good reason for
>doing so.

Well, in your last post supporting DBEngine(0)(0) over CurrentDB()
you actually adduced no advantages over CurrentDB() other than
speed, which is not an issue in circumstances where CurrentDB()
would be viable in the first place (you never need to do a loop
that at the beginning of it creates a reference to a database with
CurrentDB()).

We now have an actual case where DBEngine(0)(0) does *not* return
the same reference as CurrentDB(). Seems to me it is now a settled
issue: always use CurrentDB() when you want a reference to the
currently opened MDB.

--
David W. Fenton                        http://www.bway.net/~dfenton
dfenton at bway dot net                http://www.bway.net/~dfassoc



Mon, 01 Aug 2005 03:00:46 GMT  
 dbEngine(0)(0) is the wrong file


Quote:
>On Feb 12 2003, 12:04 am, "Allen Browne"


>> Under what circumstances can dbEngine(0)(0) refer to a file
>> other than Currentdb()?

>> <snip problem description>

>> Anyone else experienced this, or know the cause?

>Yes, this is a known problem. Take a look at these search results:
>http://groups.google.com/groups?&q=wzmain80.mde+group%3A*access*+au
>thor%3Ad imitri+author%3Afurman

Wow, that took me back to the thread launched by this post:

http://groups.google.com/groups?selm=35F60823.42EF%40sprintmail.com

That discussion included these participants:

  Kery Hardwick
  Dev Ashish
  Terry Kreft
  You
  Fernando Martins
  Terry Wickenden
  Andy Baron
  Ken Getz

Oh, how the mighty CDMA has fallen!

--
David W. Fenton                        http://www.bway.net/~dfenton
dfenton at bway dot net                http://www.bway.net/~dfassoc



Mon, 01 Aug 2005 03:36:19 GMT  
 
 [ 15 post ] 

 Relevant Pages 

1. Binary files - what am I doing wrong?

2. Recordset: What am I doing wrong?

3. What am I doing wrong??

4. What am I doing wrong?

5. Help with syntax. What am I doing wrong

6. What am I doing wrong?

7. What am I doing wrong?

8. What am I doing wrong?

9. Please tell me what I am doing wrong - DAO parameter Append Query :(

10. What am I doing wrong? -MultiSelect List box

11. Select Case - What am I doing wrong?

12. What am I doing wrong (easy).

 

 
Powered by phpBB® Forum Software