Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connect to SQL2005 mdf file with classic asp

Status
Not open for further replies.

44nato44

Programmer
Dec 12, 2008
115
NL
Hi

I have been trying for a while to connect to sql2005 mdf file but it just will not do it.

I had to downgrade from sql2008 database to a sql2005 mdf file so we could use it with our provide.

Hope somebody can help

This is the code I have got :

dim dbconn,sql,dbcomm,dbread
dbconn=New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ShellMLLPtest.mdf;Integrated Security=True;User Instance=True")
dbconn.Open()
sql="select * from dimBusiness"
dbcomm=New SqlCommand(sql,dbconn)
dbread=dbcomm.ExecuteReader()
 
a) check if the local firewall is blocking SQL (add sql to the exeptions)
b) You must connect to the local SQL server, not the file (as you do with access). It looks like you are using SQL Express?

go here:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top