Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

ASP and SQL connection 2005

Posted on 2006-07-02
5
Medium Priority
?
203 Views
Last Modified: 2012-08-14
Experts,

I need help setting up a SQL Server 2005 db connection using ASP. I have no problem connecting using Access but because SQL doesn't have a physical address to link to, I'm not sure how to set it up. I'm using XP and SQL Server is working fine when I connect using Coldfusion.

Thanks for your help
0
Comment
Question by:rruth
[X]
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
  • 2
  • 2
5 Comments
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 17027435
For SQL Server authentication use this connection string:
Provider=SQLNCLI;Server=YourServerNameGoesHere;Database=YourDatabaseGoesHere;UID=YourUserNameGoesHere;PWD=YourPasswordGoesHere;"
0
 

Author Comment

by:rruth
ID: 17027467
I've tried to set this up like the examples I have for the Access db. Where am I going wrong? - Thank you for your help!

<%
serverName = "BABYRUTH4\SQLEXPRESS"
MyDatabase = "empsolutions"
MyUserId = "sa"
MyPassword = "password"

Set conn1 = Server.CreateObject("ADODB.Connection")

conn1.Open "Provider=" & SQLNCLI;Server=serverName;Database=MyDatabase;UID=MyUserId;PWD=MyPassword;

Set RS1      = Server.CreateObject("ADODB.Recordset")

%>
0
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 1000 total points
ID: 17027492
Change this:

conn1.Open "Provider=" & SQLNCLI;Server=serverName;Database=MyDatabase;UID=MyUserId;PWD=MyPassword;

To:
conn1.Open "Provider=SQLNCLI;Server=" & serverName & ";Database=" & MyDatabase & ";UID=" & MyUserId & ";PWD=" & MyPassword & ";"
0
 
LVL 12

Expert Comment

by:Einstine98
ID: 17027513
a good help for everybody

http://www.connectionstrings.com/

Kept up-to-date
0
 

Author Comment

by:rruth
ID: 17027600
acperkins,

Thanks that worked great!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

610 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