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("sq lserver") = "CLESIO"
Application("st rcn") = "Provider=SQLOL EDB.1;Persist Security
Info=False;User ID=sa;Data Source=" + Application("sq lserver") +
";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("st rcn")declared in VBSCRIPT straight on
the Javascript?
<script language='JavaS cript'>
function ValidaProdutos( )
{
alert("Aqui");
var conn = new ActiveXObject(" ADODB.Connectio n") ;
var connectionstrin g = "Provider=SQLOL EDB.1; Data Source=CLESIO;
Initial Catalog=DBO_CRE ; User ID=sa;Password= "
conn.Open(conne ctionstring)
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_Ls Padrao") + ","
+ document.all['Cod_Presente'][i].value + "," +
document.all['txtQTD'][i].value + "," +
document.all['txtQTD'][i].value + "," + session("Cod_Fu nc");
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_Ls Padrao") + ","
+ document.all['Cod_Presente'][i].value + "," +
document.all['txtQTD'][i].value + "," +
document.all['txtQTD'][i].value + "," + session("Cod_Fu nc");
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("sq lserver") = "CLESIO"
Application("st rcn") = "Provider=SQLOL EDB.1;Persist Security
Info=False;User ID=sa;Data Source=" + Application("sq lserver") +
";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("st rcn")declared in VBSCRIPT straight on
the Javascript?
<script language='JavaS cript'>
function ValidaProdutos( )
{
alert("Aqui");
var conn = new ActiveXObject(" ADODB.Connectio n") ;
var connectionstrin g = "Provider=SQLOL EDB.1; Data Source=CLESIO;
Initial Catalog=DBO_CRE ; User ID=sa;Password= "
conn.Open(conne ctionstring)
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_Ls Padrao") + ","
+ document.all['Cod_Presente'][i].value + "," +
document.all['txtQTD'][i].value + "," +
document.all['txtQTD'][i].value + "," + session("Cod_Fu nc");
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_Ls Padrao") + ","
+ document.all['Cod_Presente'][i].value + "," +
document.all['txtQTD'][i].value + "," +
document.all['txtQTD'][i].value + "," + session("Cod_Fu nc");
rs.Open(SQL, conn)
}
rs.Close;
conn .close;
}
</script>
Comment