PC Review


Reply
Thread Tools Rate Thread

DAO and Win7

 
 
Mikey
Guest
Posts: n/a
 
      8th Oct 2010
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}
 
Reply With Quote
 
 
 
 
David-W-Fenton
Guest
Posts: n/a
 
      9th Oct 2010
Mikey <(E-Mail Removed)> wrote in
news:i8o3s4$5fm$(E-Mail Removed):

> 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.

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/
 
Reply With Quote
 
Mikey
Guest
Posts: n/a
 
      9th Oct 2010
On 10/8/2010 9:53 PM, David-W-Fenton wrote:
> Mikey<(E-Mail Removed)> wrote in
> news:i8o3s4$5fm$(E-Mail Removed):
>
>> 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.
>


Thanks, David.

D2010 is Delphi. I should have been more descriptive. CreateOleObject is correct.
This has worked for years on an XP box.
 
Reply With Quote
 
David-W-Fenton
Guest
Posts: n/a
 
      11th Oct 2010
Mikey <(E-Mail Removed)> wrote in
news:i8qle1$5vl$(E-Mail Removed):

> On 10/8/2010 9:53 PM, David-W-Fenton wrote:
>> Mikey<(E-Mail Removed)> wrote in
>> news:i8o3s4$5fm$(E-Mail Removed):
>>
>>> 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.
>>

>
> 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.

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/
 
Reply With Quote
 
Mikey
Guest
Posts: n/a
 
      11th Oct 2010
On 10/11/2010 1:50 PM, David-W-Fenton wrote:
> Mikey<(E-Mail Removed)> wrote in
> news:i8qle1$5vl$(E-Mail Removed):
>
>> On 10/8/2010 9:53 PM, David-W-Fenton wrote:
>>> Mikey<(E-Mail Removed)> wrote in
>>> news:i8o3s4$5fm$(E-Mail Removed):
>>>
>>>> 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.
>>>

>>
>> 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?
>


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.
 
Reply With Quote
 
David-W-Fenton
Guest
Posts: n/a
 
      12th Oct 2010
Mikey <(E-Mail Removed)> wrote in
news:i8vr90$i64$(E-Mail Removed):

> On 10/11/2010 1:50 PM, David-W-Fenton wrote:
>> Mikey<(E-Mail Removed)> wrote in
>> news:i8qle1$5vl$(E-Mail Removed):
>>
>>> On 10/8/2010 9:53 PM, David-W-Fenton wrote:
>>>> Mikey<(E-Mail Removed)> wrote in
>>>> news:i8o3s4$5fm$(E-Mail Removed):
>>>>
>>>>> 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.
>>>
>>> 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?

>
> 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?

>> 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?


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.

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/
 
Reply With Quote
 
Mikey
Guest
Posts: n/a
 
      13th Oct 2010
On 10/12/2010 3:55 PM, David-W-Fenton wrote:
> Mikey<(E-Mail Removed)> wrote in
> news:i8vr90$i64$(E-Mail Removed):
>
>> On 10/11/2010 1:50 PM, David-W-Fenton wrote:
>>> Mikey<(E-Mail Removed)> wrote in
>>> news:i8qle1$5vl$(E-Mail Removed):
>>>
>>>> On 10/8/2010 9:53 PM, David-W-Fenton wrote:
>>>>> Mikey<(E-Mail Removed)> wrote in
>>>>> news:i8o3s4$5fm$(E-Mail Removed):
>>>>>
>>>>>> 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.
>>>>
>>>> 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?

>>
>> 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?
>
>>> 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?

>
> 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.


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.


>


 
Reply With Quote
 
David-W-Fenton
Guest
Posts: n/a
 
      14th Oct 2010
Mikey <(E-Mail Removed)> wrote in
news:i94g4q$sr2$(E-Mail Removed):

> 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....

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/
 
Reply With Quote
 
Mikey
Guest
Posts: n/a
 
      15th Oct 2010
On 10/14/2010 4:40 PM, David-W-Fenton wrote:
> Mikey<(E-Mail Removed)> wrote in
> news:i94g4q$sr2$(E-Mail Removed):
>
>> 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....
>


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.
 
Reply With Quote
 
David-W-Fenton
Guest
Posts: n/a
 
      16th Oct 2010
Mikey <(E-Mail Removed)> wrote in
news:i9839n$ick$(E-Mail Removed):

> On 10/14/2010 4:40 PM, David-W-Fenton wrote:
>> Mikey<(E-Mail Removed)> wrote in
>> news:i94g4q$sr2$(E-Mail Removed):
>>
>>> 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....

>
> 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.

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/
 
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
Never will be a Microsoft NNTP Windows 7 group; ever. (was: There is no Win7 group What is the most active group for Win7?) N. Miller Windows XP General 6 21st Apr 2011 01:36 PM
Never will be a Midrosoft NNTP Windows 7 group; ever. (was: There is no Win7 group What is the most active group for Win7?) N. Miller Windows XP General 0 17th Apr 2011 08:47 PM
copying from WinXP to Win7 slow while copying from Win7 to WinXP very fast someone@somewhere.com Windows Vista General Discussion 1 11th Apr 2011 02:45 PM
copying from WinXP to Win7 slow while copying from Win7 to WinXP very fast someone@somewhere.com Windows XP General 1 11th Apr 2011 02:45 PM
copying from WinXP to Win7 slow while copying from Win7 to WinXP very fast someone@somewhere.com Windows XP Performance 0 11th Apr 2011 02:52 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:41 PM.