S
Sandra
Hi all,
I´m new on these stuf and....
I´m running this JAVASCRIPT code in my ASP page and I´m 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 I´m 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'].value
Cod_Parametro = document.all['hdCodParametro'].value
SQL = "Exec dbo_CRE.dbo.sp_IN_0029T " + session("Cod_LsPadrao") + ","
+ document.all['Cod_Presente'].value + "," +
document.all['txtQTD'].value + "," +
document.all['txtQTD'].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'].value + "," +
document.all['txtQTD'].value + "," +
document.all['txtQTD'].value + "," + session("Cod_Func");
rs.Open(SQL, conn)
}
rs.Close;
conn .close;
}
</script>
I´m new on these stuf and....
I´m running this JAVASCRIPT code in my ASP page and I´m 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 I´m 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'].value
Cod_Parametro = document.all['hdCodParametro'].value
SQL = "Exec dbo_CRE.dbo.sp_IN_0029T " + session("Cod_LsPadrao") + ","
+ document.all['Cod_Presente'].value + "," +
document.all['txtQTD'].value + "," +
document.all['txtQTD'].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'].value + "," +
document.all['txtQTD'].value + "," +
document.all['txtQTD'].value + "," + session("Cod_Func");
rs.Open(SQL, conn)
}
rs.Close;
conn .close;
}
</script>