Solved

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

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

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 82

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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

760 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

18 Experts available now in Live!

Get 1:1 Help Now