hello everyone
this is my code
<html><script src="otsdc.js"></script>
<head>
<script type="text/javascript" >
//var oracledb = require('oracledb');
var conn_str = "";
var dbHost = "";
var dbUser = "";
var dbPassword = "";
var dbProvider = "";
var dbDefault = "";
var PORT="";
function getData()
{
dbHost = "localhost";
dbUser = "sms";
dbPassword = "SYSCON";
dbProvider = "oracledb";
dbDefault = "P4BSID";
PORT="1521";
//var constring="Provider=OraOLEDB.Oracle;Data Source=(DESCRIPTION=(CID=GTU_APP)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))(CONNECT_DATA=(SID=P4BSID)(SERVER=DEDICATED)));User Id=sms;Password=SYSCON;";
conn_str = "Provider="+dbProvider+";Data Source="+dbHost+"; User Id="+dbUser+"; password="+dbPassword+"; Initial Catalog="+dbDefault+"; port="+PORT;
try
{
var conn = new ActiveXObject ("ADODB.Connection");
document.write("SDFDF");
conn.Open(conn_str);
document.write("SDFDF");
alert(conn+"SUCESSFUL");
}
catch(e)
{
alert("Error creating Connection"+err.message);
//document.getElementById("demo").innerHTML = err.message;
}
}
</script>
</head>
<body >
<input type="button" onclick="getData()" value="click">
</body>
</html>
it didnot work should i have libaray contain connection method like open() .
please help me ..