Hello,
I was wondering if someone could help me with a problem connecting to MS SQL server from JavaScript code. The following code is failing at connection.Open(connectionstring);
SQL and IIS 6 are on two different server but on same network. I have opened firewall port 1433; what other items should I look at?
Thank you,
// Script...
<script>
function consignee() {
var consid = document.getElementById("consid").value;
var consname = document.getElementById("consname");
try
{
var connection = new ActiveXObject("ADODB.Connection");
}
catch(e)
{
alert("ADODB namespace not found.");
exit(0);
}
try
{
var connectionstring="Data Source=1.2.3.4;Initial Catalog=SQLDB;User ID=user_id;Password=password;Provider=SQLOLEDB";
connection.Open(connectionstring);
}
catch(e)
{
alert("Cannot connect to SQL DB.");
exit(0);
}
...
</script>