This topic is locked

SQLServer 2005 express

8/31/2008 2:25:51 PM
ASPRunnerPro General questions
E
enrique author

I have no problem connecting to the database during design but cannot connect at runtime.

the message is often related to authorization.
While the tutorials are good for setting up the connection I would really appreeciate a step by step on how to setup SQL server express and make a successful web connection.
If it were a very simple typical setup I am sure I could navigate and make my more complicated databases work.
I have not been successful using the ODBC dialog or the DSN method
I can create connectiosn in other products which actually make the connections.
Any help related to a checklist on making sure your database can be connected to woudl be great.
This is typical of the errors

Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open database "city" requested by the login. The login failed.
/include/dbcommon.asp, line 122
dbconnect.asp

<%

strConnection = "DSN=CITY;UID=sa;PWD=password"

%>
This is the error message I get after following the setup tutorial.
ADODB.Stream error '800a0bba'
File could not be opened.
/libs/smarty.asp, line 182
My server
windows 2003 standard

IIS6
database SQLSERVER2005 express
The ODBC setup works

In enter the server name the sa user and password then select the default database and all goes well

I build the app and it just does not work.

J
Jane 9/2/2008

Hi,
try to connect using ODBC driver dialog on the Datasource type tab.

E
enrique author 9/2/2008

Hi,

try to connect using ODBC driver dialog on the Datasource type tab.



I have,

That also doesnt work.

I think what I am missing is related to the SQL server Authentication system.
If I ever figure it out I will write up a step by step to install SQL Server on a server.

To set the permissions to allow access to the database over the network.

Then to create an ASPrunner application which actually can access the database wihout a 500 error or an anuthentication error.
Almost all of my errors wind up related to the contents of dbconnection.ASP.
What is frustrating is that during the dialogs I use to build the application I have access to the server. What I wonder is why the same credentials used to acces the data during the building of the applicatin dont find their way into the connection string used to run the application.

***

I am having some luck though.
It seems the SA user & password work.
Now I would like to use some other user and password which also woudl work by tnot allow so much control.
The areas which need to be checked are.

DNS or hosts

using IIS administrator on the server see if you can browse the application from the list of websites.

If it is possible to browse there it is likely a DNS or Hosts header file issue.
It's getting better.

Thanks

S
stealthwifi 9/3/2008

dbconnection.asp

<%

strConnection = "DRIVER=SQL Server;SERVER=SERVER\SQLEXPRESSSERVER;UID=sa;APP=AspRunner Professional Application;WSID=PC;DATABASE=DBName;Trusted_Connection=Yes"

%>
Make sure your user has appropriate permissions for SQL and for the Database.
Example SQL Server name Billy

Go into Security Folder > Logins and be sure your user is there (as you gave sa as the example it should allready be there)

Go into Databasename > Security > Users and make sure user is there (sa) and has appropriate permisions.
Right Click your SQLServer name and select Properties - go to Security and make sure your appropriate mode is set (maybe check your logging to get a better idea of what is happening)
All this is done inside Microsoft SQL Server Management Studio Express
In your SQL Express configuration manager you might want to make sure your TCP/IP protocal is enabled (depending on your setup and enviroment)
It could be many things and may be diffrent depending on diffrent enviroments and your needs.
Hope this helps get you started!
Cheers,

M
myPCdoctor 9/7/2008

enrique, there are a few things to be aware of (of couse in addition to the other pointers in this topic):

  1. sais notrecommended for use with SQL 2K5 & 2K8. In fact, he will probably bark at you if you try to use sa. I suggest creating a seperate user for access to the DB,
  2. you must explicitly give permisssions to the SQL user that will connect to the DB. Goto the Properties of your Table, Select Permissions in the left window pane, then add your user to the table giving it Insert, Update, Select, Delete etc. I had to do this in order for the DSN to work,
  3. Try creating a DSN using the SQL Native Client. I have one DB that I had to use this client with (don't know why, but the basic ODBC connector wouldn't work),
  4. In any case, you should select the default Database for the DSN connection. This is more a secrity issue than anything else. You are basically forcing the connection to use a particular table. This (purportadly) prevents a user using this DSN to connect to different DB.
    Also, run the SQL Configuration Manager and enable the protocols that you will use, Named Pipes, TCP/IP etc. I also suggest that protocols not being used should be disbaled (they should be by default).
    These are some of the principles and pointers I teach in my SQL courses.
    I hope these help.