Solved

Connection String for Classic ASP to SQL Server 2008

Posted on 2009-05-18
5
8,680 Views
Last Modified: 2012-06-27
I am trying to use ASP code to connection to a SQL Server 2008 instance.  The Web server and Database server are separate machines.  We have some ASP.NET code with connection strings in a web.config file that works fine.  But when I try the same connection strings with classic ASP I get an error saying:
"Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified "

Below is the working ASP.NET string.  And some of the classic ASP strings I've tried with no luck.
My guess is that it is something with the server address being:
192.168.76.101\theServer
Can I combine IP address with server name like that?  If not, I don't have a named pipes name for this server that I know of.
WORKING:

<add name="FF_D1" connectionString="Data Source=192.168.1.55\theserver;Initial Catalog=SE_D1;Persist Security Info=True;User ID=CoAdmin;Password=Mypass2001"

          providerName="System.Data.SqlClient" />
 

Error in Classic ASP:

ConnString = "Data Source=192.168.1.55\theServer;Initial Catalog=SE_D1;Persist Security Info=True;User ID=CoAdmin;Password=Mypass2001"
 

I've also tried this:

 ConnString = "Driver={SQL Server};Data Source=192.168.1.55\theServer,1433;Network Library=DBMSSOCN;Initial Catalog=SE_D1;User ID= CoAdmin;Password=Mypass2001;"
 

With this one I get the error:

[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied.

 ConnString = "Driver={SQL Server};Server=192.168.1.55\theServer;Database=SE_D1;Uid=CoAdmin;Pwd=Mypass2001;"

Open in new window

0
Comment
Question by:Thread7
5 Comments
 
LVL 57

Expert Comment

by:Raja Jegan R
ID: 24418517
All connection strings for SQL Server 2008 here:

http://www.connectionstrings.com/sql-server-2008

Kindly select the appropriate connection string based upon your Client or provider
0
 
LVL 1

Author Comment

by:Thread7
ID: 24422447
I've tried just about all these Connection Strings with no luck.  
Remember I CAN connection with ASP.NET code.
I cannot simply create an ODBC system or user DSN through Control Panel.  I am thinking it is because the OS on the web server is just a standard Windows 2003.  There hasn't been anything else installed.  Therefore maybe I need sql 2008 drivers?  But then why does ASP.NET connect fine?

0
 
LVL 4

Expert Comment

by:CoveyCraig
ID: 24511651
You can connect using the TCP/IP method with classic ASP.

Use this format, it'll work.

Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;
0
 
LVL 1

Accepted Solution

by:
Thread7 earned 0 total points
ID: 25044794
Nope.  Looks like my Win 2003 Server didn't have a SQL 2008 (SQL10) driver that it needs.
0
 
LVL 4

Expert Comment

by:shrikantss
ID: 27448466
0
  i got the solution................ for classical asp connection string is
myConnection.ConnectionString = "Driver={SQL Server};Server=xxx.xxx.xxx.xxx,1533;Database=mydb;Uid=user123;Pwd=user123d;"
it will surely work dont u worry for anything..............
 
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There have been several questions about Large Transaction Log Files in SQL Server 2008, and how to get rid of them when disk space has become critical. This article will explain how to disable full recovery and implement simple recovery that carries…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now