I’m trying to open SQL connection in asp code. Trying to use the example of your code at http://support.Winhost.com/KB/a688/how-to-query-sql-database-with-asp-using-dsn-less-connection.aspx with connection string I see in my "SQL Manage" section. See below code sample: DIM objConn Set objConn = Server.CreateObject("ADODB.Connection") objConn.Open "PROVIDER=SQLOLEDB;Data Source=***;Initial Catalog=***;User ID=***;Password=***;Integrated Security=False," The following error has been generated: Provider error '80040e21' Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done. Any idea what is wrong? Can anyone post an example of asp code that works?
Try updating the connection string with this line. cnnSimple.Open "Provider=SQLOLEDB;Data Source=YOURDBSERVER;" _ & "Initial Catalog=YOURDBNAME;User Id=YOURUSERID;Password=YOURPASSWORD;" _ & "Connect Timeout=15;Network Library=dbmssocn;"
Adding "Connect Timeout=15;Network Library=dbmssocn;" instead of "Integrated Security=False," generates following error: Microsoft OLE DB Provider for SQL Server error '80004005' [DBNETLIB][ConnectionOpen (Connect()).]Specified SQL server not found.
Is the application on your computer or have you uploaded it on the server. This error can be misleading. The error typically means that it cannot connect to the SQL server. Usually when I see this port 1433 or 14330 is being blocked.
I was able to make SQL server registration and to connect to SQl with Microsoft SQL management Studio on my home comuter. So, I assume 1433 and 14330 should be ok.
I tested your site, and uploaded a file called testdbWinhost.asp to your root. I used your connection string info and I was able to connect to your database. Try looking at this link. futures-emini-trading.com/testdbWinhost.asp You can see that it was able to connect. You can download this file on your computer and review the connection string I created. You should be able to use this for your application.
Thanks for the update. I'll have our systems administrator look into this. It should work with the tcp: in front of the server name, but if it doesn't then we'll need to modify our documentation.