View Full Version : Permission denied: 'dbConn'
08-20-2007, 10:25 PM
I have been trying to install an ASP ticketing system written in ASP and using SQL Express Database.
All database tables are configured, however, when I attempt to log in I get the following error.
Active Server Pages error '00000000'
Create object failed
An error occurred while creating object 'dbConn'.
Microsoft VBScript runtime error '800a0046'
Permission denied: 'dbConn'
/helpCentricLoginConfirm.asp, line 49
Thanks for yor help..
08-20-2007, 10:28 PM
This is probably a username/password issue. Your dbConn statement is also probably using a DSNLess connection, in which you have to specify the username and password to connect to your database.
Look at the code that defines dbConn and make sure you are using the right username and password.
If you are, make sure that user exists in the SQL database.
08-20-2007, 10:35 PM
Thanks for the fast response,
I will post the connection code here shortly..
I assumed also is was a user/password issue, but I know I can connect to the SQL server through SQL server Stuio express with teh same user/Password I have in my connection string.
Everything looks good on the connection string and on the SQL Server.
but for some reason I keep getting this error.
08-20-2007, 10:42 PM
Im using the following as my connection string
The DB Name and username/password are all verified correct
08-21-2007, 01:18 AM
What exactly does line 49 state?
Also try this:
if dbConn.State = 1 then
response.write(" You have successfully connected to the database ")
response.write(" You have not connected ")
08-21-2007, 02:21 AM
The connection string resides ina file called global.asa
The Line 49 code resides in file helpCentricLoginConfirm.asp
the code on line 49 is ""dbconn.open connectstr" the entire code is listed below
'##### validate the account and password
connectStr = Application("shs1sql_ConnectionString")
spHC_adminLoginValidate.CommandText = "spHC_adminLoginValidate"
spHC_adminLoginValidate.CommandType = 4
spHC_adminLoginValidate.CommandTimeout = 30
spHC_adminLoginValidate.ActiveConnection = dbConn
spHC_adminLoginValidate.Parameters.Append spHC_adminLoginValidate.CreateParameter("RETURN_VALUE" ,3 ,&H0004)
08-21-2007, 02:47 AM
Do you think it could be the server or IIS thats not allowing the asp script to run? Reason I ask is because I installed the template on another Windows Server 2003, IIS6, SQL Express, and it works fine with the codes it already has. But on this server it doesn't.
I tried to match up the setting with both servers and all seems to look the same. cant figure what could be wrong.
08-21-2007, 03:01 AM
Attached is the two files in question.
08-21-2007, 03:53 AM
That could very well be the issue.
In IIS, RIGHT CLICK your site in question and click on PROPERTIES. Then, under the HOME DIRECTORY, make sure you have READ and WRITE both checked.
Make sure that the EXECUTE PERMISSIONS is SCRIPT ONLY, and lastly, make sure that your IUSR has READ permissions on your www directory.
08-21-2007, 04:02 AM
I checked the IIS and all permissions are as they should be for the directory.
is their a template I could use to test the SQL connection string?
I would like to somehow test the connection string in an ASP login or somthing, just to see if its the string or somthing with the IIS server running an ASP script.
08-21-2007, 04:12 AM
Sorry I didn't catch this before, but your connection string should never reside in the global.asa. That's a security risk.
We will deal with that later...
Create an new page called test.asp.
Set Conn = Server.CreateObject("ADODB.Connection")
If Conn.State = 1 then
response.write(" You connected successfully ")
response.write(" Something went wrong ")
Set Conn = nothing
In the connection string, replace your 'myDatabase', 'mypassword', 'myusername', and 'myServerAddress' with the actual values that you know work.
If you still cannot connect there, then we have larger issues at hand.
08-21-2007, 04:25 AM
Yes, the code you gave me worked..
"You connected successfully "
08-21-2007, 04:30 AM
OK. So what that tells us is that you can create objects on your server and that you can connect to your database.
Looking at your Global.Asa file that you attached, line 26, did you replace the default values there with your values that you know work?
Application("shs1sql_ConnectionString") = "PROVIDER=SQLOLEDB;Database=yourDatabaseName;SERVER=your.sqlserver.com;PASSWORD=yourPassword;UID=your UserID;User Id=yourUserID;"
If so, try removing the 'User Id=yourUserID;' part of the connection string.
08-21-2007, 04:37 AM
Yes, on the server I have all the correct connection information in my Global.asa file.
08-21-2007, 04:39 AM
Did you remove the 'User Id=yourUserId;' part from the connection string?
08-21-2007, 04:41 AM
Last item of note - have your restarted your site since you modified the global.asa file?
In other words, did you go into IIS, Right Click on your site, All Tasks > STOP ... then START or just RESTART IIS?
08-21-2007, 04:46 AM
yes, I just did, but smae issue, Im going to use the connection string from teh Test.asp in my Global.asa and see if that works there.
08-21-2007, 04:51 AM
I wonder if it matters that this ASP site is in a Sub-Domain of my site.
I will try to place it in the root and see if it works there.
08-21-2007, 04:57 AM
I finally found the issue.
The ASP site wants to be in the root directory of the IIS web site.
However, I dont want it there, I need it in my Sub-domain any ideas?
When I put it back in the sub-domain I get the Permission denied error when trying to create dbconn.
08-21-2007, 05:06 AM
How are your sub-domains set up?
As folders under root with different DNS A-Records and Host Header values, or as different applications in IIS?
If the latter, then you can use different global.asa files for each sub-domain.
If the former, then you may need to consider changing over to application sub-domains, or just keep your global.asa in root and let your sub-domain access it that way.
08-21-2007, 05:15 AM
Yes, with a Folder under the root
Subdomain ( Folder) = subdomain.RootDomain.com
SO I can put the Golobal.asa in the root and access it that way?
I would guess I would need to tell the files in the sub domain where the Global.asa file is , huh?
08-21-2007, 05:17 AM
No, since the folder is under the ROOT, you have to place the global.asa file in the root.
If you want to use subdomain.root.com with its own global.asa, you need to create a "sub-web" in IIS, pointing the home directory to your folder, then creating the global.asa file there.
08-21-2007, 05:24 AM
Daemonspyre THanks a BUNCH for your help.
I guess I will try to creat a sub-web, need to find out how though.
Seems putting the global.asa in the root isnt working for me either.
I appriciate all you time , I've learned a lot in the process.
08-21-2007, 05:26 AM
Glad I could help. Please let me know if have any other questions.
Don't forget to try their tech support, too... They may have an updated version of their software (or at least their FAQ) which might help you in the long run.
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.