[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

VWD2008 express + classic asp + connnection string to SQL Server 2008 express

Posted on 2008-11-15
5
Medium Priority
?
598 Views
Last Modified: 2013-11-27
Hi,

I'm creating an few clasic asp pages and I wan to connect to a SQL Server 2008 express database.

I'm using Visual Web Developer 2008 express, and I've tried

set conn = server.CreateObject("ADODB.Connection")
set rs = server.CreateObject("ADODB.Recordset")

connstring = "Provider=GARRY-PC\SQLEXPRESS;Initial Catalog=myDatabase;Persist Security Info=True;User ID=sa;Password=mypassword"

conn.open constring


...but the page is failing to load. I can see the database open in the database explorer....


Any ideas?






0
Comment
Question by:thegunner
  • 3
  • 2
5 Comments
 
LVL 5

Expert Comment

by:MMeijer
ID: 22970692
'conn.open constring' should be 'conn.open connstring' :)

you can test connectionstrings by putting one into a textfile saved with the .udl extension after double clicking it a connectionstring util pops up with a 'test connection' button.
0
 

Author Comment

by:thegunner
ID: 22971093
Hi, sorry  that was just a typo when writing the question. It doesn't connect with connstring'

I've tried connecting via a .udl file but doesn;t seem to be working. I wonder if this is becasue it's an express version.

I can see the database when connecting when viwing through Management Studio...



0
 
LVL 5

Accepted Solution

by:
MMeijer earned 500 total points
ID: 22971151
the connectionstring isn't correct, try making one with the udl tool.
or try replacing the following
Provider=GARRY-PC\SQLEXPRESS;
with
Provider=SQLOLEDB.1; Data Source=GARRY-PC\SQLEXPRESS;
0
 

Author Comment

by:thegunner
ID: 22971248
Hi,

Yes add this worked!   Provider=SQLOLEDB.1; Data Source=GARRY-PC\SQLEXPRESS;


Excellent ,cheers.
0
 
LVL 5

Expert Comment

by:MMeijer
ID: 22971274
and the udl tool prevent us from making bad connectionstrings :)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
In this article I will describe the Copy Database Wizard 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 is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Integration Management Part 2

872 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