DAO and Win7

M

Mikey

This D2010 project works fine on my XP box, but fails on the 'dbE.Opendatabase' line
on Win7 with EOleSysError with message 'Error loading type library/DLL.', but doesn't
identify what it can't load.

The database is copied from the XP box, and is password protected. Double-clicking it
in the Download folder opens it in fine in Access. The copy in the ProgramData\PWB
folder fails with 'Not a valid password'.

Thanks, Mike

DBPath equates to C:\ProgramData\PWB\clock.mdb. The database is Access2000.

{code}
DBPath := WritePath + DBName;
dbE := CreateOleObject('DAO.DBEngine.36');
//open
try
dbDAO := dbE.OpenDatabase(DBPath, True, False, ';pwd=' + edtUserPW.Text);
except
on E:Exception do
begin
MessageDlg('Error opening database.'#13#10 + E.Message, mtInformation, [mbOK],0);
Application.Terminate;
exit;
end;
{code}
 
D

David-W-Fenton

dbE := CreateOleObject('DAO.DBEngine.36');

This should just be:

CreateObject('DAO.DBEngine.36');

I've never used CreateOleObject for any VBScript. I don't even know
what it's for.
 
M

Mikey

This should just be:

CreateObject('DAO.DBEngine.36');

I've never used CreateOleObject for any VBScript. I don't even know
what it's for.

Thanks, David.

D2010 is Delphi. I should have been more descriptive. CreateOleObject is correct.
This has worked for years on an XP box.
 
D

David-W-Fenton

D2010 is Delphi. I should have been more descriptive.
CreateOleObject is correct. This has worked for years on an XP
box.

Ah. I wonder if the problem is the database password. Also, is it
64-bit Win7 or regular 32-bit? Have you tried the OpenDatabase
command on a database that has no database password?

Those are things that seem relevant to me.

There could also be some sandbox-mode issues there, but I have no
idea how to deal with those from outside Access.
 
M

Mikey

Ah. I wonder if the problem is the database password. Also, is it
64-bit Win7 or regular 32-bit? Have you tried the OpenDatabase
command on a database that has no database password?

It's 64 bit. It reacts the same with a no-password .mdb.
Those are things that seem relevant to me.
Agreed.

There could also be some sandbox-mode issues there, but I have no
idea how to deal with those from outside Access.
I haven't been in a sand-box for over 60 years now... ;-> What's a sand-box issue?
Maybe relevant: Delphi's counterpart to Access' preferences doesn't see DAO360.dll.
 
D

David-W-Fenton

It's 64 bit. It reacts the same with a no-password .mdb.

I assume it wouldn't compile for 64-bit with DAO involved, so you're
compiling for x86 target system?
I haven't been in a sand-box for over 60 years now... ;-> What's a
sand-box issue?

Well, sandbox mode mostly controls what you can do in Jet, not its
ability to open a file, but it's worth a shot. There could also be
issues with UAC interfering. I recently had to manually edit
registry keys on a WinXP workstation that wouldn't allow me to set
macro security in A2003 OFF even though I was running as a domain
administrator. But I was able to set the registry keys manually.
Maybe relevant: Delphi's counterpart to Access' preferences
doesn't see DAO360.dll.

That seems pretty relevant to me. Have you checked
Stackoverflow.com? I see a few Access-related Delphi questions on
there. There might be enough Delphi programmers there to help you
out, as I don't think the issue is a Jet/DAO problem at all.
 
M

Mikey

I assume it wouldn't compile for 64-bit with DAO involved, so you're
compiling for x86 target system?


Well, sandbox mode mostly controls what you can do in Jet, not its
ability to open a file, but it's worth a shot. There could also be
issues with UAC interfering. I recently had to manually edit
registry keys on a WinXP workstation that wouldn't allow me to set
macro security in A2003 OFF even though I was running as a domain
administrator. But I was able to set the registry keys manually.


That seems pretty relevant to me. Have you checked
Stackoverflow.com? I see a few Access-related Delphi questions on
there. There might be enough Delphi programmers there to help you
out, as I don't think the issue is a Jet/DAO problem at all.

Thanks, David.
I'll take a look there. I think it's wound up in UAC somewhere, but that's still kind
of a swamp for me.
 
D

David-W-Fenton

I think it's wound up in UAC somewhere, but that's still kind
of a swamp for me.

UAC means you have to write your application to work properly when
run as a user. You won't ever have administrative permissions.

Of course, you should have been doing that since the release of
Windows 2000....
 
M

Mikey

UAC means you have to write your application to work properly when
run as a user. You won't ever have administrative permissions.

Of course, you should have been doing that since the release of
Windows 2000....

Yep.
The app RUNS fine on a Win7 box, if I compile it on an XP box. I just can't compile
it on a win 7 box (at least that one), because Delphi can't see the dao360.dll, so
has no interface to it.
 
D

David-W-Fenton

Yep.
The app RUNS fine on a Win7 box, if I compile it on an XP box. I
just can't compile it on a win 7 box (at least that one), because
Delphi can't see the dao360.dll, so has no interface to it.

Hmm. Really, there shouldn't be any difference, seems to me. But
then, I'm just an Access programmer, and don't have to deal with
compiling at that level.
 

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

Similar Threads

Jet error 6

Top