Hi,

Im writing an asp site using vbscript. It accesses my SQL-Server
through an ODBC-Datasource that is defined on the IIS. The code is

set Conn = CreateObject("ADODB.Connection")
Conn.open "DSN=XXX;UID=YYY;pwd=ZZZ"
Set RS = CreateObject("ADODB.Recordset")
sql = "SELECT * FROM tblMyTab WHERE Col1='Test'"
RS.open sql, conn
msgbox RS.fields("Col2")
RS.close

I'm using this code twice: (1) Once in the main procedure that is
executed everytime the page ist displayed and a second time (2) in a
sub that is called by an on_click event. In both cases it works
correctly, but:

Only in case (2) there come up two messages (translated):

"ADO-Security Warning: This website uses an dataprovider who is
prabably not secure. If you trust the website, click OK, otherwiese
click cancel."

and thereafter

"ADO-Security Warning: This website is using your identity while
accessing a datasource. If you trust the website, click OK, otherwiese
click cancel."

Does anyone know how to prevent this messages? Why do they only come
up in (2)?

Thank you in advance!

Marco

Re: ADO-Security Warnings accessing Datasource by marco

marco
Fri Mar 11 12:27:31 CST 2005

I understand now:

In case (1) the code is executed local on the client (script!).
Unfortunately I had there a datasource of the same name that was
connected to the same database. That's why it worked and I did not
find my misstake eralier. And that's the reason for the messages too:
The website tries to access data through the loacal datasource.

Happy again!

M