468,133 Members | 1,149 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,133 developers. It's quick & easy.

error....Safety settings.....

Hi all,

Im new on these stuf and....
Im running this JAVASCRIPT code in my ASP page and Im getting the
error: Safety settings on this computer prohibit accessing a data
source on another domain.

....on my asp page I have the connection like that..

Thanks
<%
Application("sqlserver") = "CLESIO"
Application("strcn") = "Provider=SQLOLEDB.1;Persist Security
Info=False;User ID=sa;Data Source=" + Application("sqlserver") +
";Initial Catalog=DBO_CRE"
%>

....and Im trying to connect in the JAVASCRIPT to execute a
procedure.... How do I do that? Is this a correct code ? Is there
anyway to use the Application("strcn")declared in VBSCRIPT straight on
the Javascript?

<script language='JavaScript'>

function ValidaProdutos()
{
alert("Aqui");
var conn = new ActiveXObject("ADODB.Connection") ;

var connectionstring = "Provider=SQLOLEDB.1; Data Source=CLESIO;
Initial Catalog=DBO_CRE; User ID=sa;Password="

conn.Open(connectionstring)

var rs = new ActiveXObject("ADODB.Recordset");

var Valor_Solic;
var Cod_Parametro;

if( document.all['txtdias'].length )
{

for(i=0; i < document.all['txtdias'].length ; i++)
{
Valor_Solic = document.all['txtdias'][i].value
Cod_Parametro = document.all['hdCodParametro'][i].value
SQL = "Exec dbo_CRE.dbo.sp_IN_0029T " + session("Cod_LsPadrao") + ","
+ document.all['Cod_Presente'][i].value + "," +
document.all['txtQTD'][i].value + "," +
document.all['txtQTD'][i].value + "," + session("Cod_Func");
rs.Open(SQL, conn)

}
}
else
{
Valor_Solic = document.all['txtdias'].value
Cod_Parametro = document.all['hdCodParametro'].value
SQL = "Exec dbo_CRE.dbo.sp_IN_0029T " + session("Cod_LsPadrao") + ","
+ document.all['Cod_Presente'][i].value + "," +
document.all['txtQTD'][i].value + "," +
document.all['txtQTD'][i].value + "," + session("Cod_Func");
rs.Open(SQL, conn)
}
rs.Close;
conn .close;
}
</script>
Jul 20 '05 #1
1 4591


Sandra wrote:
Im running this JAVASCRIPT code in my ASP page and Im getting the
error: Safety settings on this computer prohibit accessing a data
source on another domain.

...on my asp page I have the connection like that..

Thanks
<%
Application("sqlserver") = "CLESIO"
Application("strcn") = "Provider=SQLOLEDB.1;Persist Security
Info=False;User ID=sa;Data Source=" + Application("sqlserver") +
";Initial Catalog=DBO_CRE"
%>

...and Im trying to connect in the JAVASCRIPT to execute a
procedure.... How do I do that? Is this a correct code ? Is there
anyway to use the Application("strcn")declared in VBSCRIPT straight on
the Javascript?

<script language='JavaScript'>

function ValidaProdutos()
{
alert("Aqui");
var conn = new ActiveXObject("ADODB.Connection") ;

var connectionstring = "Provider=SQLOLEDB.1; Data Source=CLESIO;
Initial Catalog=DBO_CRE; User ID=sa;Password="


Use a HTML <form> to post the data to your ASP page and then in the ASP
page connect to the data base and store the data.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Peter Frost | last post: by
6 posts views Thread by Sherif ElMetainy | last post: by
1 post views Thread by Steven Baeten | last post: by
35 posts views Thread by jeffc226 | last post: by
4 posts views Thread by dancer | last post: by
3 posts views Thread by dancer | last post: by
5 posts views Thread by =?GB2312?B?17/HvyBaaHVvLCBRaWFuZw==?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.