countrygirl35
Programmer
I'm trying to create a recordset that goes out to an sql database and checks to see if a record exists. I've researched and cannot find a syntax that works correctly.
Any ideas?
<script type="text/javascript">
function movenext(){
var strzip=document.getElementById("Zip");
var cn = new ActiveXObject("ADODB.Connection");
var strConn = "FILEDSN=D:\Inetpub\DSN\sale.dsn";
cn.Open(strConn);
var rs = new ActiveXObject("ADODB.Recordset");
var SQL = "SELECT * FROM IVRADM.T_SALES_LKP_Sales_Region WHERE Zip_Code = strzip ";
rs.Open(SQL, cn,2,3);
if(rs.eof){
alert("zipnotcorrect");
}
}
</script>
Any ideas?
<script type="text/javascript">
function movenext(){
var strzip=document.getElementById("Zip");
var cn = new ActiveXObject("ADODB.Connection");
var strConn = "FILEDSN=D:\Inetpub\DSN\sale.dsn";
cn.Open(strConn);
var rs = new ActiveXObject("ADODB.Recordset");
var SQL = "SELECT * FROM IVRADM.T_SALES_LKP_Sales_Region WHERE Zip_Code = strzip ";
rs.Open(SQL, cn,2,3);
if(rs.eof){
alert("zipnotcorrect");
}
}
</script>