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: MOD Implementation
 Object Required Error
 New Topic  Topic Locked
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 3

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 04 June 2008 :  15:46:52  Show Profile  Send ruirib a Yahoo! Message
quote:
Originally posted by AnonJr

I'm embarrassed that I missed it... though I am also consoled that rui missed it too.


Yeah, right, use me as a scapegoat .<


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

Carefree
Advanced Member

Philippines
4222 Posts

Posted - 04 June 2008 :  16:36:28  Show Profile
Well, I wish I had good news. Here's the routine without the strSql= bits:

<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="inc_sha256.asp"-->
<!--#INCLUDE FILE="inc_func_common.asp" -->
<!--#INCLUDE FILE="inc_header.asp" -->
<!--#INCLUDE FILE="inc_func_member.asp" -->
<!--#INCLUDE FILE="inc_func_secure.asp" -->
<%
	strSql = "SELECT G.USERGROUP_ID, G.MEMBER_ID, " &_
		"M.MEMBER_ID, M.M_NAME " &_
		"FROM " & strTablePrefix & "USERGROUP_USERS G, " & strMemberTablePrefix & "MEMBERS M " &_
		"WHERE G.USERGROUP_ID = 8 AND M.MEMBER_ID = " & G.MEMBER_ID & " " &_
		"ORDER BY M_NAME"
	set rsNames = my_conn.execute(strSql)
	Do while not rsNames.EOF and not rsNames.BOF
		if tmpStrNames = "" then
			tmpStrNames = rsNames("M_NAME")
		else
			tmpStrNames = tmpStrNames & "," & rsNames("M_NAME")
		end if
	rsNames.movenext
	loop
	Response.Write	tmpStrNames
	rsNames.close
	set rsNames = Nothing
%>


And here's the result:
quote:

Microsoft VBScript runtime error '800a01a8'
Object required: 'g'

/itw/test.asp, line 8



No change, except for leaner code.<
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 04 June 2008 :  18:29:09  Show Profile  Send ruirib a Yahoo! Message
Do a Response.Write of the strSql value.<


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

Carefree
Advanced Member

Philippines
4222 Posts

Posted - 04 June 2008 :  21:46:36  Show Profile
OK - Response Writing Sql after line 1 results in this:

SELECT G.USERGROUP_ID, G.MEMBER_ID, 


after line 2:

SELECT G.USERGROUP_ID, G.MEMBER_ID, M.MEMBER_ID, M.M_NAME 


So far, so good.

after line 3:

SELECT G.USERGROUP_ID, G.MEMBER_ID, M.MEMBER_ID, M.M_NAME FROM FORUM_USERGROUP_USERS G, FORUM_MEMBERS M 


Hanging in there. But after line 4, I'm back to the error message. Adding M. to the order routine doesn't fix it, G. won't work because it's in the M table, but I tried it anyway. Same error.

Deleting the order routine doesn't have any effect, same error.

The problem seems to REALLY be in the fourth line. If I switch the order of comparing the two member IDs, the error changes to object required "M" - but still referring to the first line of strSql.

So far, still baffled.
<

Edited by - Carefree on 04 June 2008 21:47:24
Go to Top of Page

Carefree
Advanced Member

Philippines
4222 Posts

Posted - 04 June 2008 :  21:50:12  Show Profile
I did notice that the error switches from a small letter "g" to a capital letter "M". I have no idea why it uses a small "g", though.

If I do not compare the two Member ID's, the error goes away, but the procedure cannot work. Maybe a join command will have to be used, but not sure how to word it.<

Edited by - Carefree on 04 June 2008 22:04:13
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 04 June 2008 :  21:53:01  Show Profile  Visit AnonJr's Homepage
I suspect the part in red needs to be the variable of the MEMBER_ID you're looking for.

	strSql = "SELECT G.USERGROUP_ID, G.MEMBER_ID, " &_
		"M.MEMBER_ID, M.M_NAME " &_
		"FROM " & strTablePrefix & "USERGROUP_USERS G, " & strMemberTablePrefix & "MEMBERS M " &_
		"WHERE G.USERGROUP_ID = 8 AND M.MEMBER_ID = " & G.MEMBER_ID & " " &_
		"ORDER BY M_NAME"
<
Go to Top of Page

Carefree
Advanced Member

Philippines
4222 Posts

Posted - 04 June 2008 :  22:11:12  Show Profile
Just on the off-chance that the letter G was causing the error, I switched all of Gs to the letter N. No good. Now object required 'n'<
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 04 June 2008 :  22:40:31  Show Profile  Visit AnonJr's Homepage
Because the part I highlighted in red in my previous post is not a part of the string you are building, VBScript is looking for an object "G" to do/get/set "MEMBER_ID"

If you're looking for a particular member, you'll need to replace the part in red with wherever you're holding the member ID.<
Go to Top of Page

Carefree
Advanced Member

Philippines
4222 Posts

Posted - 04 June 2008 :  22:58:21  Show Profile
OK, I rewrote it with a join statement:

	strSql = "SELECT USERGROUP_USERS.USERGROUP_ID, USERGROUP_USERS.MEMBER_ID " &_
		"FROM " & strTablePrefix & "USERGROUP_USERS, " &_
		"JOIN " & strMemberTablePrefix & "MEMBERS " &_
		"ON USERGROUP_USERS.MEMBER_ID = MEMBERS.MEMBER_ID, " &_
		"SELECT MEMBERS.M_NAME " & _
		"WHERE USERGROUP_USERS.USERGROUP_ID = 8, " &_
		"ORDER BY MEMBERS.M_NAME"


and I get a new error:
quote:

Syntax error in FROM clause.

test.asp, line 17



Of course, line 17 isn't the problem, it's the execution line.

Here's the Response Write of the strSql:
quote:

SELECT USERGROUP_USERS.USERGROUP_ID, USERGROUP_USERS.MEMBER_ID FROM FORUM_USERGROUP_USERS, JOIN FORUM_MEMBERS ON USERGROUP_USERS.MEMBER_ID = MEMBERS.MEMBER_ID SELECT MEMBERS.M_NAME WHERE USERGROUP_USERS.USERGROUP_ID = 8, ORDER BY MEMBERS.M_NAME
<
Go to Top of Page

Carefree
Advanced Member

Philippines
4222 Posts

Posted - 04 June 2008 :  23:01:48  Show Profile
quote:
Originally posted by AnonJr

Because the part I highlighted in red in my previous post is not a part of the string you are building, VBScript is looking for an object "G" to do/get/set "MEMBER_ID"

If you're looking for a particular member, you'll need to replace the part in red with wherever you're holding the member ID.



G.MEMBER_ID was in the first line of the code.<
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 05 June 2008 :  04:44:43  Show Profile  Send ruirib a Yahoo! Message
You're missing quotes in the WHERE clause, but you can simply add the G.MEMBER_ID in the previous string:


<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="inc_sha256.asp"-->
<!--#INCLUDE FILE="inc_func_common.asp" -->
<!--#INCLUDE FILE="inc_header.asp" -->
<!--#INCLUDE FILE="inc_func_member.asp" -->
<!--#INCLUDE FILE="inc_func_secure.asp" -->
<%
	strSql = "SELECT G.USERGROUP_ID, G.MEMBER_ID, " &_
		"M.MEMBER_ID, M.M_NAME " &_
		"FROM " & strTablePrefix & "USERGROUP_USERS G, " & strMemberTablePrefix & "MEMBERS M " &_
		"WHERE G.USERGROUP_ID = 8 AND M.MEMBER_ID = G.MEMBER_ID " &_
		"ORDER BY M_NAME"
	set rsNames = my_conn.execute(strSql)
	Do while not rsNames.EOF and not rsNames.BOF
		if tmpStrNames = "" then
			tmpStrNames = rsNames("M_NAME")
		else
			tmpStrNames = tmpStrNames & "," & rsNames("M_NAME")
		end if
	rsNames.movenext
	loop
	Response.Write	tmpStrNames
	rsNames.close
	set rsNames = Nothing
%>


<


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

Carefree
Advanced Member

Philippines
4222 Posts

Posted - 05 June 2008 :  06:47:55  Show Profile
Ahhhh - not as a variable to be read.... Can't believe I didn't try that.... Thanks.

Now if I can only figure out why the body list isn't populating.<
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 05 June 2008 :  08:35:56  Show Profile  Visit AnonJr's Homepage
What are you trying to accomplish? i.e. are you trying to get a list of all the members in Group 8?<
Go to Top of Page

Carefree
Advanced Member

Philippines
4222 Posts

Posted - 05 June 2008 :  09:24:59  Show Profile
I got that part fixed. Now I have a new error (this project will drive me to drink).

Here's the Release routine:

	If Request.Form("Method_Type") = "Release" Then
		strSql = "SELECT MEMBER_ID FROM " & strMemberTablePrefix & "MEMBERS " &_
			"WHERE M_NAME = " & Request.Form("RPrisoner") & ""
			Response.Write	strSql
		my_conn.execute(strSql)
		PRISON_ID = MEMBER_ID
		strSql = "SELECT USERGROUP_ID, MEMBER_ID, MEMBER_TYPE, ORIGINAL_ID " &_
			"FROM " & strTablePrefix & "USERGROUP_USERS " &_
			"WHERE MEMBER_ID = PRISON_ID"
			Response.Write	strSql
		my_conn.execute(strSql)
		USERGROUP_ID = ORIGINAL_ID
		strSQL = "UPDATE " & strTablePrefix & "USERGROUP_USERS SET USERGROUP_ID = '" & ORIGINAL_ID & "', MEMBER_ID = '" & PRISON_ID & "', MEMBER_TYPE = 1 WHERE MEMBER_ID = '" & PRISON_ID & "'"
		Response.Write strSql
		Set rsRelease = Server.CreateObject("ADODB.Recordset")
	  call sendReleaseMail(PRISON_ID)
		Set rsRelease = my_conn.execute(strSQL)
		WriteFooter
		Response.End
	End If


And here's the release form:

		"								<form action=""warden.asp"" method=""post"" id=""release"" name=""release"">" & vbNewLine & _
		"									<input type=""hidden"" value=""Release"" name=""Method_Type"">" & vbNewLine & _
		"										<table border=""0"" colspan=""2"" cellspacing=""1"" cellpadding=""1"" align=""center"">" & vbNewLine & _
		"											<tr>" & vbNewLine & _
		"												<td align=""right"" bgcolor=""" & strForumCellColor & """>" & vbNewLine & _
		"													<font color=""" & strDefaultFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Release Prisoner: </b>" & vbNewLine & _
		"													</font>" & vbNewLine & _
		"												</td>" & vbNewLine & _
		"												<td align=""left"" bgcolor=""" & CategoryCellColor & """>" & vbNewLine & _
		"													<input type=""text"" name=""RPrisoner"" style=""width:150px;"">" & vbNewLine & _
		"													</input>" & vbNewLine & _
		"												</td>" & vbNewLine & _
		"											</tr>" & vbNewLine & _
		"											<tr valign=""middle"">" & vbNewLine & _
		"												<td bgColor=""" & strForumCellColor & """ colspan=""2"" align=""center""><input type=""submit"" value=""Submit"" id=""submit1"" name=""submit1"">" & vbNewLine & _
		"												</td>" & vbNewLine & _
		"											</tr>" & vbNewLine & _
		"										</table>" & vbNewLine & _
		"									</input>" & vbNewLine & _
		"								</form>" & vbNewLine


I'm getting this error message:
quote:

Microsoft JET Database Engine error '80040e10'

No value given for one or more required parameters.

Line 84 (the my_conn.execute line)



But here's the result of the strSql:

quote:

SELECT MEMBER_ID FROM FORUM_MEMBERS WHERE M_NAME = Testing123



Does the member name require quotation marks?<

Edited by - Carefree on 05 June 2008 09:31:26
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 05 June 2008 :  09:30:26  Show Profile
Yes.

<

Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page
Page: of 3 Previous Topic Topic Next Topic  
Previous Page | 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.39 seconds. Powered By: Snitz Forums 2000 Version 3.4.07