LAN with database giving error messages

A

Andrew Poulos

The following is only for IE running under Windows. Its a client
"requirement".

Anyhow, I'm connecting via a web page to a database. Both the page and
the database are on a LAN. The database has a DSN (as opposed to needing
a connection string). Everything appears to be working as expected
except that whenever there's any attempt at talking with the database
these two errors pop up:

"This website uses a data provider that may be unsafe. If you trust the
website, click OK, otherwise click Cancel."

"This website is using your identity to access a datasource. If you
trust this website, click OK to continue, otherwise click Cancel."

The javascript that talks with the database looks not unlike this:

var cnLocal = new ActiveXObject("ADODB.Connection");
cnLocal.Open(DSNdata);
var SQLstr = "SELECT "+info+" FROM "+pref;
var cnSel = cnLocal.Execute(SQLstr);

What can be done to suppress the errors as everything is on a LAN not
connected to the internet and so a very low security threat? (Ideally it
should not be something that has to be done to each computer that views
the web page.)


I tried (thinking wishfully) using this HTML tag instead

<object id="objID" scope="application" progid="ADODB.Connection"></object>

with

cnLocal = document.getElementById("objID");

and

cnLocal.Open(DSNdata);
var SQLstr = "SELECT "+info+" FROM "+pref;
var cnSel = cnLocal.Execute(SQLstr);

but it gives a object does not support this method error.


Andrew Poulos
 
T

Thomas 'PointedEars' Lahn

Andrew said:
The following is only for IE running under Windows. Its a client
"requirement".

Anyhow, I'm connecting via a web page to a database. Both the page and
the database are on a LAN. The database has a DSN (as opposed to needing
a connection string). Everything appears to be working as expected
except that whenever there's any attempt at talking with the database
these two errors pop up:

"This website uses a data provider that may be unsafe. If you trust the
website, click OK, otherwise click Cancel."

"This website is using your identity to access a datasource. If you
trust this website, click OK to continue, otherwise click Cancel."

The javascript that talks with the database looks not unlike this:

var cnLocal = new ActiveXObject("ADODB.Connection");
cnLocal.Open(DSNdata);
var SQLstr = "SELECT "+info+" FROM "+pref;
var cnSel = cnLocal.Execute(SQLstr);

What can be done to suppress the errors as everything is on a LAN not
connected to the internet and so a very low security threat? [...]

Looks like you want to add the Web site to MSHTML's Trusted Sites list.
It may be possible to distribute that with a group policy.

This has nothing to do with JS/ES.


PointedEars
 
A

Andrew Poulos

Thomas said:
Andrew said:
The following is only for IE running under Windows. Its a client
"requirement".

Anyhow, I'm connecting via a web page to a database. Both the page and
the database are on a LAN. The database has a DSN (as opposed to needing
a connection string). Everything appears to be working as expected
except that whenever there's any attempt at talking with the database
these two errors pop up:

"This website uses a data provider that may be unsafe. If you trust the
website, click OK, otherwise click Cancel."

"This website is using your identity to access a datasource. If you
trust this website, click OK to continue, otherwise click Cancel."

The javascript that talks with the database looks not unlike this:

var cnLocal = new ActiveXObject("ADODB.Connection");
cnLocal.Open(DSNdata);
var SQLstr = "SELECT "+info+" FROM "+pref;
var cnSel = cnLocal.Execute(SQLstr);

What can be done to suppress the errors as everything is on a LAN not
connected to the internet and so a very low security threat? [...]

Looks like you want to add the Web site to MSHTML's Trusted Sites list.
It may be possible to distribute that with a group policy.

I was kind of wondering that if I created the object in a different way
then perhaps I wouldn't get the messages appearing. I tried using an
OBJECT tag

<object id="conn" progid="ADODB.Connection"></object>

and then using

var cnLocal = document.getElementById("conn");
cnLocal.Open(DSNdata);
var SQLstr = "SELECT "+info+" FROM "+pref;
var cnSel = cnLocal.Execute(SQLstr);

while I don't get the warning message I get an "object does not support
this property or method" error.

Andrew Poulos
 
T

Thomas 'PointedEars' Lahn

Andrew said:
Thomas said:
Andrew said:
[...]
The javascript that talks with the database looks not unlike this:
var cnLocal = new ActiveXObject("ADODB.Connection");
cnLocal.Open(DSNdata);
var SQLstr = "SELECT "+info+" FROM "+pref;
var cnSel = cnLocal.Execute(SQLstr);
What can be done to suppress the errors as everything is on a LAN not
connected to the internet and so a very low security threat? [...]
Looks like you want to add the Web site to MSHTML's Trusted Sites list.
It may be possible to distribute that with a group policy.

I was kind of wondering that if I created the object in a different way
then perhaps I wouldn't get the messages appearing.

If that worked, it would be a huge security leak.
I tried using an OBJECT tag

_element_, not tag
<object id="conn" progid="ADODB.Connection"></object>

and then using

var cnLocal = document.getElementById("conn");
cnLocal.Open(DSNdata);
var SQLstr = "SELECT "+info+" FROM "+pref;
var cnSel = cnLocal.Execute(SQLstr);

while I don't get the warning message I get an "object does not support
this property or method" error.

That is the usual result with fantasy coding. Since when does the
`object' element have a `progid' attribute and, provided this was
MSHTML-proprietary, since when does MSHTML support it?

You will have to use the `classid' attribute and provide the CLSID
(class ID) of the ActiveX/COM control in its value for the remote
chance that your code could work.[1] You can find the CLSID in the
Windows Registry (HKCR\CLSID) when searching for the name you used;
the CLSID should be the key name and the name its default value. With
my Windows XP SP2 office system, the CLSID for `ADODB.Connection' is
`{00000514-0000-0010-8000-00AA006D2EA4}'.

[1] http://msdn2.microsoft.com/en-us/library/ms533559.aspx


HTH

PointedEars
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top