Author |
Topic |
btrfly0915
Starting Member
7 Posts |
Posted - 2010-05-07 : 13:59:46
|
Windows Server 2003, IIS 6.0, SQL Server 2005 Express (all on same server) Snitz ForumsWhen I try to access the setup.asp page for Snitz 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".On SQL Server, I have setup an empty database folder called Snitz, It is using our Windows Authentication. IIS is using anonymous login user and the Internet Guest Account has Read, Read&Execute, and List permissions.I have setup a System DSN in ODBC to test the database connection and it said completed successfully. I have also tried both of the connection strings listed in the the config.asp file and have tried different ways to address my server, but actually took out the uid and pwd statement(wasn't sure if I should leave it). I get the error each way.This last try, my connection string looks like this:strDBType = "sqlserver"strConnString = "Provider=SQLOLEDB;Data Source=localhost\SQLserver;database=Snitz;" **I have also tried strConnString = "Provider=SQLOLEDB;Data Source=hostname\SQLserver;database=Snitz;"strConnString = "Provider=SQLOLEDB;Data Source=hostname\SQLserver\SQLExpress;database=Snitz;" andHave tried the ODBC conn string for MS SQL too.Any suggestions would be helpful and greatly appreciated! |
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2010-05-07 : 14:45:18
|
Can you access the database from Management studio (or other querying tool)? If not, what are the errors you get?If this is express, datasource should likely be <hostname>\SQLExpress as that's the name that, by default, the SQL Express instance is installed with. You will need some security info in the connection string. Either username and password (please don't post them) if you're using SQL security, or 'TrustedConnection=true' if you're using windows authenticationYou need to connect to SQL and make sure that the user has the correct permissions in the database. You mention an explorer folder, but don't say anything about the database itself.--Gail ShawSQL Server MVP |
|
|
btrfly0915
Starting Member
7 Posts |
Posted - 2010-05-10 : 13:26:48
|
Thank you for your response! Yes I can access it with SQL Server Management Studio Express from my computer and with the ODBC Data Source Administrator. I worded my previous statement wrong, it's not an explorer folder, its a new empty database. I just tried the statement below and it still gives me the same error...Ive tried it with and without the "SQLServerName" and with/without "SQLExpress" in the statement..I'm really stuck here!strConnString = "Provider=SQLOLEDB;Data Source=hostname\SQLServerName\SQLExpress;TrustedConnection=true;database=Snitz;" |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2010-05-10 : 17:06:59
|
After fixing the data source as Tara suggest, does it work? If not, does the windows account that you're using have permission to access that database?--Gail ShawSQL Server MVP |
|
|
btrfly0915
Starting Member
7 Posts |
Posted - 2010-05-11 : 08:39:54
|
Okay.... I took out the phrase SQLExpress because our instance is named SQLLANSWEEPER....so this is what I end up with and it still does not work....strConnString = "Provider=SQLOLEDB;Data Source=hostname\SQLLANSWEEPER;TrustedConnection=true;database=Snitz;"You'll have to excuse me, Im not experienced with SQL so I'm learning as I go along. In management studio, I went to Security, Logins, went to Builtin Users and the Server Users, User Mapping, chose the database and chose db_owner and public for both User Groups. I'm not sure if it has to do with why i cant open the database or not, but i mentioned before that the SQL server is using windows authentication and IIS is using Anonymous login and i gave the Internet Guest Account Read, Read&Execute, and List permissions to my actual Forum folder that holds all the setup files. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
btrfly0915
Starting Member
7 Posts |
Posted - 2010-05-11 : 14:18:58
|
*Yes, hostname\SQLLANSWEEPER is the same name I'm using to connect in Management Studio.*I have Management Studio installed on my regular desktop computer and I am able to connect to the database stored on the SQL Server.*On this same desktop computer, I am trying to access the setup.asp which is one of the forum config files on the Web Server through my web browser, which is when the error occurs. I'm not sure if you're familiar with Snitz, but the setup.asp file points to the config.asp file which is where the conn string is placed. So in my personal browser, I'm trying to open the setup.asp file which is suppose to help setup the forum database.*The Web Server and SQL Server same machine*1st Question....You suggested trying the hostname,portnumber.....so would I leave out the instance and just putData Source=hostname,portnumber or Data Source=hostname,portnumber\SQLLANSWEEPER?*2nd Question....Does it matter if I put TrustedConnection=true before database=Snitz? |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
btrfly0915
Starting Member
7 Posts |
Posted - 2010-05-12 : 13:48:10
|
I was hoping so much that would work...but nope! This is what I tried,strConnString = "Provider=SQLOLEDB;Data Source=hostname,portnumber;database=Snitz;TrustedConnection=true;"and I even tried the ODBC string with the portnumberstrConnString = "driver={SQL Server};server=hostname,portnumber;database=Snitz;TrustedConnection=true;"I really have no idea what else to check..... I wonder if my connection strings aren't whats wrong....maybe Snitz is requiring me to have other things setup a certain way that they do not specify in the readme file?! |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
btrfly0915
Starting Member
7 Posts |
Posted - 2010-05-12 : 15:06:50
|
The Test Succeeded.....I chose that Provider, Connection info used was 1. hostname\SQLLANSWEEPER 2. Use Windows Integrated security 3. Chose Snitz database |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
btrfly0915
Starting Member
7 Posts |
Posted - 2010-05-12 : 15:33:36
|
Okay, I was starting to think the same thing because I've tried almost everything! I will try to post in SnitzForums and see if anyone has an idea....Thank You so much for your time and help!! :) |
|
|
|