Solved

Need connection string for asp page using SQL Server Express 2008 instance

Posted on 2014-09-11
3
338 Views
Last Modified: 2014-09-17
I need a connection string for connecting an asp page to SQL Server Express 2008 instance.

I am currently using:
Dim connGlobal, mSQL1, rs1
set connGlobal = server.createobject("ADODB.Connection")
connGlobal.Open "Provider=SQLOLEDB.1;Data Source=SERVER\EXACTSQLEXPRESS;Initial Catalog=intranet; User ID=userid;Password=password;"
'mSQL1 = "SELECT * FROM extensions"

Open in new window


All I get is:

500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.
0
Comment
Question by:princeservice
  • 2
3 Comments
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 40317726
I installed SQL Native Client to make the connections to SQL Server Express 2008.  This is an example of a connection string using it.
connectstr = "Provider=SQLNCLI10;Server=YOURSERVER\SQLEXPRESS;Database=TestDB;Uid=username; Pwd=password;"

Open in new window

If your code is running on the machine that has SQL Server Express 2008 on it, then the SQL Native Client is already installed.  If you are running on a different machine, then you need to install SQL Native Client and enable Remote Connections on the server and make sure both the server and the client have TCP/IP connections enabled.  http://www.connectionstrings.com/download-sql-server-native-client/
0
 

Author Comment

by:princeservice
ID: 40328478
I used your connection string but as soon as I do a connectstr.open I get the 500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 40328638
That connection string works between two of my machines.  I assume the ASP page and the SQL Server are on different machines.  That means that you have enable remote connections on the SQL Server and have a username and password that is allowed to connect remotely.
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

In this article I will describe the Detach & Attach 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.
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

772 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