I have installed MS SQL Server desktop on a PC running XPPRO
I am logged in as Administrator and have write permissions on all folders on the PC but
when i try to connect to the SQL database, (from within ASP.NET Web matrix an error message pops up
"Unable to connect to database server
SQL server does not exist or access is denied.
ConnectionOpen (Connect())"
(I have disabled Nortons AV just in case)
I am completely stumped on this one and any help would be most appreciated
Phil
Can we see your connection string (please obfuscate any user name/password info)?
This is a local SQL database on your machine, correct? Verifythat SQL Server is running; check the SQL Server Service Manager inyour systray and verify that it says running.
Verify the name of your SQL server by shelling out to a command prompt and typing:
osql -L
|||Thanks for your suggestions Terri.
Yes SQL server is running on my machine - it starts up automatically when I log on.
I dont have a database as yet (I haven't got that far!)
I am trying to teach myself ASP.NET on a work PC which is normally networked but I am running it as a stand alone PC with networking disabled and logged on to the PC rather than the network.
At the command prompt the OSQL -L command that you suggested returns "local"
When I was installing the MSDE software I ran the setup file at the command prompt as follows
setup SAPWD=mypassword SEQURITYMODE=SQL
I don't know what the connection string is but I am trying to connect using ASP.NET Web Matrix.
In the ASP.NET Web Matrix connection window dialogue it gives the server as localhost (I have also tried "local" without success)
I select "SQL server authentication" and give
Username sa
Passwordmypassword
I then choose "Create a new database" from the bottom left of the connection window dialogue and enter a name after which i get the error popup
"Unable to connet to database server
Server does not exist or access denied.
ConnectionOpen (connect())"
Back at the command prompt I have tried ...
osql -S -U sa -Pmypassword
and this seems to work in that the DOS prompt dissappears and is replaced by digits (exit gets me back to the dos prompt)
Again I would be most grateful for any suggestions to help me get past this brick wall!
Thanks
Phil
|||This is important. local must be enclosed in parentheses, like this:
(local)
So, choose (local) as your database, and <gulp> sa as your User name and mypassword as your password. SeeDISCLAIMER!
DISCLAIMER: Never use the saaccount for applications! We are just using the sa account hereto prove to yourselves that you can connect to your SQL Server and yourdatabase. This MUST be changed!!
|||
Many many thanks Tim.
I am in with one big sigh of relief from Tasmania!!
and can now continue with the remainder of my ASP.NET training.
Although I am only using MSDE for training purposes for the moment it sounds as though I need to add a new user (other than sa).
Do I need to run setup again?
Cheers
Phil
No comments:
Post a Comment