Solved

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

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

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

Suggested Solutions

Title # Comments Views Activity
Disable TLS1.0 on Win 2012 server 7 57
Display if field is NOT "" or NOT null 6 22
Html split(text) Part2 6 20
Want an individual results display div 8 40
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
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.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

735 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