Connectiing to SQL 2005 from ASP Pages

  • Thread starter Thread starter Fred Chateau
  • Start date Start date
F

Fred Chateau

I am having difficulty connecting to SQL 2005 Express from ASP Pages.

My Web site is a mix of data driven ASP.NET 2.0 pages and some complicated
ASP pages which I have not had time to migrate. I recently copied all the my
data from SQL 2000 Server to SQL Express. My ASP.NET pages connect correctly
but when I change the connecting string in my ASP pages the pages break
without returning an error.

My working connecting string in web.config:
Data Source=.\SQLEXPRESS;Initial Catalog=DatabaseName;Integrated
Security=True

My working connecting string on my ASP pages:
Provider=SQLOLEDB.1;Data Source=Server2000Name;Initial
Catalog=DatabaseName;User ID=spdbuser;Password=password

Connecting strings I have tried on my ASP pages:
Provider=SQLNCLI.1;Data Source=.\SQLEXPRESS;Initial
Catalog=DatabaseName;Integrated Security=SSPI;Persist Security Info=False
Provider=SQLOLEDB.1;Data Source=.\SQLEXPRESS;Initial
Catalog=DatabaseName;Integrated Security=SSPI;Persist Security Info=False
Data Source=.\SQLEXPRESS;Initial Catalog=DatabaseName;Integrated
Security=True

I have also tried Data Source=Server2005Name\SQLEXPRESS in the three
connecting string above.

I have verified that a connection is being made from IIS in SQL Express,
using the IUSER account but the page does not serve. I have included IUSER
in the MSSQLUser group and assigned login permissions for the MSSQLUser
group to the database.

Any ideas?

Regards,

Fred Chateau
fchateauAtComcastDotNet
 
Probably has nothing to do with your connection strings.

1. Make sure you have an acceptable protocol to connect. Open the Config
Manager and add TCP/IP or named pipes (Express is in memory only).
2. If Express is on a different machine than the web server, turn on SQL
Browser
3. Make sure Express is set up for mixed mode. By default, it is not. I do
not have an URL, but google and you should find the command line to switch
to mixed from windows auth.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

*************************************************
Think outside of the box!
*************************************************
 
...
Probably has nothing to do with your connection strings.

It _was_ the connection string, Cowboy.

ASP.NET 2.0 --> Data Source=.\SQLEXPRESS;Integrated Security=True
ASP --> Provider=SQLNCLI.1;Data Source=.\SQLEXPRESS;Integrated
Security=SSPI

"Integrated Security=True" does not work in ASP.
 
Back
Top