Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connection String Problem

Status
Not open for further replies.

Kinl

Programmer
Mar 19, 2001
168
US
Heres the problem.

I have a development server that I test everything on before I upload it to our live server. (My dev server has IIS 5 on it, and our live server has IIS 4 on it.) The live server also has SQL Server 7 on it. So I test the ASP using my development server, but I use the actual database on the live server to connect to. The connection string #1 works perfect below on the dev server (and it is inserting and updating data just fine), but when I put this code on the actual server (IIS 4 which also has the SQL server on it), the page just sits there and clocks. I did a few Response.Write's before the connection string and then one right after the connection string. It doesnt connect to the database. ANd I cant figure out why. I tried changing the SERVER= stuff, and I changed that to the Server name. This didnt work either. I left the IP on there, and it didnt work either. I even tried creating a .udl file on the server and doing it that way. But it didnt work.
ANy ideas?

The connection string I put in to test on looks like this: xxx.xx.x.xx = ip address

<%
Dim dcnDB 'ADODB.Connection

Set dcnDB = Server.CreateObject(&quot;ADODB.Connection&quot;)
dcnDB.ConnectionString = &quot;Driver={SQL Server}; uid=contest; SERVER=xxx.xx.x.xx;&quot;
dcnDB.Open
%>

Thanx,

donn

This works fine when
 
I don't think its anything to do with the version of IIS.

Try using this string:
&quot;Provider=SQLOLEDB;Data Source=Yourservername;Initial Catalog=Yourdatabasename;User ID=dbuser;Password=dbuserpassword;&quot;

The connection string should really be the same for both dev and production application because they are trying to get to the same SQL Server which is in your &quot;live&quot; server.

 
I tried this too, it didnt work. Does this need to be in a virtual directory on the server somwhere?

-d
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top