From: McKirahan on
I have an HTA which works fine for me on Win98 SE and WinXP SP2.
However, it doesn't work on my client's WinXP SP2 laptop.

The error message is:
"Safety settings on this computer prohibit accesing a data source on another
domain."

The URL is file://C:\Documents and Settings\Test.hta

It fails when it tries to open an MS-Access database:

Const cDSN = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
Const cMDB = "Test.mdb"
Set objADO = CreateObject("ADODB.Connection")
objADO.Open(cDSN & cMDB)

The HTA and MDB files are in the same folder.

How is a local database "on another domain"?

I've compared many security settings between the two
WinXP machines and saw no differences.

Can anyone shed some light on this? Thanks in advance.


From: Ato Bisda on
Since HTA uses IE, your code is probably subject to the computer's Internet Options' settings.

In your browser, go to Tools, Internet Options, Security Tab, Custom Level,

"Access Data Sources Across Domains" is an option under the Miscellaneous Section

HTH,
Ato

"McKirahan" <News(a)McKirahan.com> wrote in message news:4IWdnecMpLyV3vTfRVn-rg(a)comcast.com...
> I have an HTA which works fine for me on Win98 SE and WinXP SP2.
> However, it doesn't work on my client's WinXP SP2 laptop.
>
> The error message is:
> "Safety settings on this computer prohibit accesing a data source on another
> domain."
>
> The URL is file://C:\Documents and Settings\Test.hta
>
> It fails when it tries to open an MS-Access database:
>
> Const cDSN = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
> Const cMDB = "Test.mdb"
> Set objADO = CreateObject("ADODB.Connection")
> objADO.Open(cDSN & cMDB)
>
> The HTA and MDB files are in the same folder.
>
> How is a local database "on another domain"?
>
> I've compared many security settings between the two
> WinXP machines and saw no differences.
>
> Can anyone shed some light on this? Thanks in advance.
>
>


From: McKirahan on
"Ato Bisda" <atobisda(a)gmail.com> wrote in message
news:OBCsSV3RFHA.204(a)TK2MSFTNGP15.phx.gbl...
> Since HTA uses IE, your code is probably subject to the computer's
Internet Options' settings.
>
> In your browser, go to Tools, Internet Options, Security Tab, Custom
Level,
>
> "Access Data Sources Across Domains" is an option under the Miscellaneous
Section
>
> HTH,
> Ato

I have that setting disabled on my PC and the HTA works.

I had the client change it to "prompt" and retest.

The prompt came up but afterwards so did the same error.

Thanks for trying though.


From: "Michael Harris (MVP)" <mikhar at mvps dot on
see inline...

McKirahan wrote:
> I have an HTA which works fine for me on Win98 SE and WinXP SP2.
> However, it doesn't work on my client's WinXP SP2 laptop.
>
> The error message is:
> "Safety settings on this computer prohibit accesing a data source on
> another domain."
>
> The URL is file://C:\Documents and Settings\Test.hta


If you really are using an explicit file:// protocaol prefix, try without
it. IIRC, protocol differences can also cause the same error.


>
> It fails when it tries to open an MS-Access database:
>
> Const cDSN = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
> Const cMDB = "Test.mdb"
> Set objADO = CreateObject("ADODB.Connection")
> objADO.Open(cDSN & cMDB)
>
> The HTA and MDB files are in the same folder.
>


Don't ssume that the current directory is the path to the HTA. It will vary
depeding on how the HTA is actually lauhed.


> How is a local database "on another domain"?
>
> I've compared many security settings between the two
> WinXP machines and saw no differences.
>
> Can anyone shed some light on this? Thanks in advance.

--
Michael Harris
Microsoft MVP Scripting
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Please ask follow-up questions via the original newsgroup thread.



From: McKirahan on
"Michael Harris (MVP)" <mikhar at mvps dot org> wrote in message
news:ejbMM45RFHA.2136(a)TK2MSFTNGP14.phx.gbl...
> see inline...
>
> McKirahan wrote:
> > I have an HTA which works fine for me on Win98 SE and WinXP SP2.
> > However, it doesn't work on my client's WinXP SP2 laptop.
> >
> > The error message is:
> > "Safety settings on this computer prohibit accesing a data source on
> > another domain."
> >
> > The URL is file://C:\Documents and Settings\Test.hta
>
>
> If you really are using an explicit file:// protocaol prefix, try without
> it. IIRC, protocol differences can also cause the same error.
>
>
> >
> > It fails when it tries to open an MS-Access database:
> >
> > Const cDSN = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
> > Const cMDB = "Test.mdb"
> > Set objADO = CreateObject("ADODB.Connection")
> > objADO.Open(cDSN & cMDB)
> >
> > The HTA and MDB files are in the same folder.
> >
>
>
> Don't ssume that the current directory is the path to the HTA. It will
vary
> depeding on how the HTA is actually lauhed.
>
>
> > How is a local database "on another domain"?
> >
> > I've compared many security settings between the two
> > WinXP machines and saw no differences.
> >
> > Can anyone shed some light on this? Thanks in advance.
>
> --
> Michael Harris
> Microsoft MVP Scripting
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> Please ask follow-up questions via the original newsgroup thread.
>


Thanks for your feedback.

The URL above is from the "Internet Explorer Script Error"
dialog which is accurate; I didn't add the "file://" protocol.