Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2014-09-11
3
339 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
sql 2014,  lock limit 5 37
Html Table looping 4 25
Html Table Looping (part 2) 5 27
Check ALL SP in database make sure there are no errors 17 43
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

840 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