Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: Database: MS SQL Server
 Cannot open database!!
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 3

btrfly0915
Starting Member

USA
18 Posts

Posted - 12 May 2010 :  15:57:00  Show Profile
*Windows Server 2003, IIS 6.0, SQL Server 2005 Express (all on same server)
*On SQL Server, I have setup an empty database called Snitz, It is using our Windows Authentication. IIS is using anonymous login user and the Website folder and the Forum folder have the Internet Guest Account having Read, Read&Execute, and List permissions.
*I have SQL Management Studio Express installed on my local desktop computer and I am able to connect to the database stored on the SQL Server.
*The Forum setup files are stored on Web Server in website folder.
*On my local computer, I am trying to access the setup.asp through my web browser, which is when the error occurs.

**When I try to access the setup.asp page from web browser to set up my forum, it gives the following error "The database could not be opened !! Check your config.asp file and set the strConnString so it points to the database. Also check if strDBType is set to the right databasetype. Code : 424".

*I have setup a System DSN in ODBC on my Web Server to test the database connection and it said completed successfully. I have also tried a .udl on my local computer and the SQL connection succeeded. I tried both of the connection strings listed in the the config.asp file and have tried different ways to address my server and I get the error each way.

*I have tried the following connection strings:
strConnString = "Provider=SQLOLEDB;Data Source=hostname\SQLLANSWEEPER;TrustedConnection=true;database=Snitz;"
strConnString = "Provider=SQLOLEDB;Data Source=hostname,portnumber;database=Snitz;TrustedConnection=true;"
*I even tried the ODBC string with the portnumber
strConnString = "driver={SQL Server};server=hostname,portnumber;database=Snitz;TrustedConnection=true;"

I have been posting in the SQLTeam Forum and cannot find an error in the connections strings so far. I'm thinking that something may be wrong in the config.asp or setup.asp files OR I may not have something setup a certain way that they didn't specify in the readme file. Any ideas?!?!


ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 12 May 2010 :  17:23:21  Show Profile  Send ruirib a Yahoo! Message
Why are you using a trusted connection? Is the IIS account set as a valid login for SQL Server?


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

btrfly0915
Starting Member

USA
18 Posts

Posted - 13 May 2010 :  13:29:45  Show Profile
IIS is using anonymous login
SQL is using windows authentication

Someone in the SQL forum told me to put Trusted Connection statement if im using windows authentication for the database on the SQL server
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 13 May 2010 :  13:42:10  Show Profile  Send ruirib a Yahoo! Message
SQL Server will have to be configured for mixed mode, unless you want to allow the IIS account access to your SQL Server, which doesn't sound too good an option...

Configure SQL Server for mixed mode, then create a login that can access the database you are using as dbowner, so that you can run the setup.asp script, changing the SQLOLEBD connection string to use the details for that user. Once setup is completed, you can change the user's role to dbddatareader and dbdatawriter which should be enough to run Snitz (except for mod addition).


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

btrfly0915
Starting Member

USA
18 Posts

Posted - 13 May 2010 :  15:22:12  Show Profile
Thank You! I see what you're saying now... makes sense, it can't authenticate the local IUSR account in IIS as a domain usr... Now I have to try to decided between the following choices:
1) Create a generic domain usr and then list as anonymous user in IIS and keep windows authentication on SQL
2) Use Integrated Security in IIS instead of anonymous
3) Allow the local IUSR account in IIS access to the SQL database (which I assume would involve #1 because the IIS account is actually a local account)

If I did your solution, use mixed mode and then create a usr on SQL, then other employees would have to have that passwd/usr name i created to log onto the forum because they would still be using the local IUSR account in IIS. Right?! Which option do you think would be best for Snitz/SQL/.asp? #1 or #2
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 13 May 2010 :  15:29:10  Show Profile  Send ruirib a Yahoo! Message
Using mixed mode won't affect any existing SQL Server users and won't affect the way forum authentication is used. No one but the forum code would have to use the SQL Server authentication account.
I think you should use mixed mode. All SQL Server based websites I have seen using Snitz use mixed mode authentication and it is used for other web apps. I don't think allowing the IIS account access to your SQL Server is that good an option.


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

btrfly0915
Starting Member

USA
18 Posts

Posted - 13 May 2010 :  15:42:04  Show Profile
The Web Server, IIS, and SQL are all on the same computer... If I use integrated security in IIS, do I keep the TrustedConnection=true statement in my connection string?
ex.
strConnString = "Provider=SQLOLEDB;Data Source=hostname\SQLLANSWEEPER;TrustedConnection=true;database=Snitz;"
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 13 May 2010 :  15:56:35  Show Profile  Visit HuwR's Homepage
no, set up SQL to use mixed mode, then create a SQL user, you then use that username/password in your connection string and remove the trustedconnection part

MVC .net dev/test site | MVC .net running on Raspberry Pi
Go to Top of Page

btrfly0915
Starting Member

USA
18 Posts

Posted - 13 May 2010 :  16:25:59  Show Profile
Okay, the server is set to mixed mode, i right clicked on database and chose new login, created a username and a password, chose the default database Snitz, then in User Mappings, I chose the database, and then chose dbowner (public was still checked by default).

My connection string looks like this:
strConnString = "Provider=SQLOLEDB;Data Source=hostname\SQLLANSWEEPER;database=Snitz;uid=username;pwd=password;"

I still get the error
Go to Top of Page

btrfly0915
Starting Member

USA
18 Posts

Posted - 13 May 2010 :  16:48:35  Show Profile
If I right-click on the SQL Server in Management Studio, the permissions tab states the user i created and has "Connect" permissions. If I expand Database folder, I right-click on the database for permissions and it has the same...
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 13 May 2010 :  16:49:12  Show Profile  Send ruirib a Yahoo! Message
I would suggest that you try the udl file to connect to the live database and then use the data in your connection string. Use the udl file with the SQL Server Authentication login.


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 14 May 2010 :  02:22:36  Show Profile  Visit HuwR's Homepage
try changing the Provider to SQLOLEDB.1


also, can you login to sql manager using the login you created?

MVC .net dev/test site | MVC .net running on Raspberry Pi
Go to Top of Page

btrfly0915
Starting Member

USA
18 Posts

Posted - 14 May 2010 :  09:07:15  Show Profile
Yes, I just tried both and they succeeded! I can login using the .udl file with the new credentials and I can login to SQL Server Management Studio Express with the same new credentials!
I will now try to use the other driver reference you mentioned....
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 14 May 2010 :  10:47:06  Show Profile  Visit HuwR's Homepage
this is the connection string used here, without any issues.

strConnString = "Provider=SQLOLEDB.1;Data Source=DSX2001-2;database=snitz2000;UID=username;PWD=password;"

MVC .net dev/test site | MVC .net running on Raspberry Pi
Go to Top of Page

btrfly0915
Starting Member

USA
18 Posts

Posted - 14 May 2010 :  10:59:22  Show Profile
Okay, I changed the Provider and it STILL does not work.... I've tried the Data Source=hostname/SQLLANSWEEPER and Data Source=hostname,portnumber.
If I have SQL and Web Server on same machine, does it matter if I put the hostname or am I suppose to use local host?
Just to verify the correct port number, its the TCP port that the SQL Server is running on if I go to Server Config Mgr, Network Config, Protocols for SQLLANSWEEPER, TCP/IP and IP Adresses tab?!

This is my string now:
strConnString = "Provider=SQLOLEDB.1;Data Source=hostname\SQLLANSWEEPER;database=Snitz;uid=username;pwd=password;"
Go to Top of Page

btrfly0915
Starting Member

USA
18 Posts

Posted - 14 May 2010 :  11:08:13  Show Profile
My connection string looks just like yours! Hmm...I've followed the directions in the readme file, but I'm wondering if something else is missing or not setup the way Snitz would assume it is?!
Go to Top of Page
Page: of 3 Previous Topic Topic Next Topic  
Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.14 seconds. Powered By: Snitz Forums 2000 Version 3.4.07