Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBScript runtime error '800a0046' 3

Status
Not open for further replies.

cretanion

Technical User
Jan 28, 2002
53
US
I am getting this error message any Clues?:
Microsoft VBScript runtime error '800a0046'
Permission denied: 'GetObject'
/first_visit.asp, line 255

'Can't find user profile...must be first visit to Intranet...

'Are we actually adding the user?
If WT.GetVariable("action", "string") = "create" Then
set rs=server.CreateObject("adodb.recordset")
sql="select max(userid) from users"
rs=db.Execute(sql)
maxid=int(rs(0))
set rs=nothing
maxid=maxid+1

'Insert a new user record
SQL = "INSERT INTO Users (UserID, UserName, FullName, NotesName, NotesMailFile, LocationID, FirstVisit, UserAgent, LastUpdate, GroupAccount, ShowWeather, ShowWebCam, ShowExternalNews, EmployeeID, ShowBusiness, ShowTechnology, ShowSports, ShowEntertainment, ShowInternalNews, ShowAutomotive, EMailSubscriptions) VALUES "
SQL = SQL & " ( " & maxid
SQL = SQL & ", " & LCase(sqlstring(sUserName))
SQL = SQL & ", " & sqlstring(WT.GetVariable("FullName", "string"))
SQL = SQL & "," & sqlstring(WT.GetVariable("NotesName", "string"))
SQL = SQL & ", " & sqlstring(WT.GetVariable("NotesMailFile", "string"))
SQL = SQL & ", " & wt.GetVariable("LocationID", "numeric")
SQL = SQL & ", '" & FormatDateTime(Date, vbShortDate) & "'"
SQL = SQL & ", " & sqlstring(Request.ServerVariables("HTTP_USER_AGENT"))
SQL = SQL & ", '" & FormatDateTime(Date, vbShortDate) & "'"
SQL = SQL & ", 0, 0, 1, 0"
SQL = SQL & ", " & WT.GetVariable("EmployeeID", "numeric")
SQL = SQL & ", 1, 0, 0, 0, 1, 0, 1)"
'SQL = "INSERT INTO Users (UserID, UserName, FullName, NotesName, NotesMailFile, LocationID, FirstVisit, UserAgent, LastUpdate, GroupAccount, ShowWeather, ShowWebCam, ShowExternalNews, EmployeeID, ShowBusiness, ShowTechnology, ShowSports, ShowEntertainment, ShowInternalNews, ShowAutomotive, EMailSubscriptions) VALUES "
'SQL = SQL & "(UserID.NextVal"
'SQL = SQL & ", " & LCase(WT.SQLEncodeString2(sUserName))
'SQL = SQL & ", " & WT.SQLEncodeString2(WT.GetVariable("FullName", "string"))
'SQL = SQL & ", " & WT.SQLEncodeString2(WT.GetVariable("NotesName", "string"))
'SQL = SQL & ", " & WT.SQLEncodeString2(WT.GetVariable("NotesMailFile", "string"))
'SQL = SQL & ", " & WT.GetVariable("LocationID", "numeric")
'SQL = SQL & ", TO_DATE('" & FormatDateTime(Date, vbShortDate) & "', 'mm/dd/rr')"
'SQL = SQL & ", " & WT.SQLEncodeString2(Request.ServerVariables("HTTP_USER_AGENT"))
'SQL = SQL & ", TO_DATE('" & FormatDateTime(Date, vbShortDate) & "', 'mm/dd/rr')"
'SQL = SQL & ", 0, 0, 1, 0"
'SQL = SQL & ", " & WT.GetVariable("EmployeeID", "numeric")
'SQL = SQL & ", 1, 0, 0, 0, 1, 0, 1)"
DB.Execute(SQL)
%>
<p class="status">You have been successfully registered.</p>

<p><a href="/">Click here to visit Webster</a>.</p>
<%

Else

'Obtain current user's full name
'Use ADSI services
NOTE: Set oUser = GetObject("WinNT://" & DomainName & "/" & sUserName)
sFullName = oUser.FullName
Set oUser = Nothing
 
make sure you have all the correct permissions to access ADSI services

-DNG
 
By default, ASP operates under the local IUSR_MachineName account. This local account is not a member of the domain... perhaps this is your permissions issue?
 
Cretanion, it sounds like the user that your connection string is using doesn't have write permissions to the database to update the records.
 
Thanks I am looking into each of your responses as a fix. I assumed it was a permission issue, but thanks for the suggestions on where it may lie.
 
What is actually opening writing to the database? Is it the Username that opens the SQL Database? Or the ASP local IUSR_MachineName account?

Thanks again.
 
I thought the error was on this line:
[tt]Set oUser = GetObject("WinNT://" & DomainName & "/" & sUserName)[/tt]

If so then the database security is not the issue.
 
You are right in that it gets to the line

Set oUser = GetObject("WinNT://" & DomainName & "/" & sUserName)

and errors out. The database admin on the SQL server has verified that the database can be read and written too, so I am assuming there is a problem here.
 
Cretanion, the user that connects to the database is usually a static user to keep the database locked down, not a variable one. Your web server might have a system DSN setup in the web servers "administrative tools" containing the details of he connection user. Or maybe the connection user is somewhere else on the code. If you don't know what user is connecting to the database then that may be your problem, it might not have one set up perhaps?
 
In the code, I have provided, can I just say go get this user info out of the sql database and display it on the page?

Your comments are appreciated :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top