0
Reply

Error when passing connectin string to activeX

sa de

sa de

Mar 26 2013 12:44 PM
1.2k
Hello all
 
I am using ActiveX in my web application in one page, it is working properly in my PC, i am passing the connection string from the web page that has the activex in it as following:
 
This is the javascript code in the page that passing the connection string to the activex:
 

<script language="javascript" type="text/javascript">       function Connect() {           var doc = document.forms[0];             var PrinterControl = document.applets('PrinterObject1');           PrinterControl.UserText = document.form1.hdnConString.value + ',' + document.form1.hdnCategory.value + ',' + document.form1.hdnLoginID.value + ',' + document.form1.hdnPassword.value + ',' + document.form1.hdnCategoryType.value;         }                 </script>   <body  önload="Connect()">     <form id="form1"  runat="server" > . . . . </form> </body>

and in the activeX code i receive the connection string and other values as following: 
 
 public String UserText         {             get              {                  return conString;              }             set             {                  conString = value;                                   string[] arrID = conString.Split(',');                  conStr = Convert.ToString(arrID[0]);                  category = Convert.ToString(arrID[1]);                  loginID = Convert.ToString(arrID[2]);                  password = Convert.ToString(arrID[3]);                  categoryType = Convert.ToString(arrID[4]);             }         }
 
Every thing working properly in my pc, but when i install this application in customer's server, the page that using activex generating error although it is working in my pc and i tested it in other pcs in my company over network still working ok, the customer using Windows2008 with sql server 2012.
 
The following is the error message generating in the page that using activex, when the page trying to load activex:
 

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 = could not open a connection to SQL Server)

Next Recommended Forum