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
Author Previous Topic Topic Next Topic
Page: of 3

Carefree
Advanced Member

Philippines
4222 Posts

Posted - 05 June 2008 :  09:43:33  Show Profile
I hope one of you guys is still checking this topic lol.

How can I change this line so the necessary quotation marks are in the sql?

			"WHERE M_NAME = " & Request.Form("RPrisoner") & ""

<
Go to Top of Page

Carefree
Advanced Member

Philippines
4222 Posts

Posted - 05 June 2008 :  09:52:54  Show Profile
Just in case I needed the Members. in front of the members table values, I tried this:


	If Request.Form("Method_Type") = "Release" Then
		strSql = "SELECT MEMBERS.MEMBER_ID FROM " & strMemberTablePrefix & "MEMBERS " &_
			"WHERE MEMBERS.M_NAME = " & Request.Form("RPrisoner") & ""
			Response.Write	strSql
		my_conn.execute(strSql)
		PRISON_ID = MEMBERS.MEMBER_ID
		strSql = "SELECT USERGROUP_ID, MEMBER_ID, MEMBER_TYPE, ORIGINAL_ID " &_
			"FROM " & strTablePrefix & "USERGROUP_USERS " &_
			"WHERE MEMBERS.MEMBER_ID = PRISON_ID"
			Response.Write	strSql
		my_conn.execute(strSql)


Resulting in the predictable:
quote:

SELECT MEMBERS.MEMBER_ID FROM FORUM_MEMBERS WHERE MEMBERS.M_NAME = Testing123


and
quote:

Microsoft JET Database Engine error '80040e10'

No value given for one or more required parameters.

line 85
<

Edited by - Carefree on 05 June 2008 09:53:23
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 05 June 2008 :  10:17:46  Show Profile
"WHERE M_NAME = '" & Request.Form("RPrisoner") & "'"
<

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

Carefree
Advanced Member

Philippines
4222 Posts

Posted - 05 June 2008 :  10:36:25  Show Profile
That gives me apostrophes (not quotation marks) around the name, and the same error.

quote:

SELECT MEMBERS.MEMBER_ID FROM FORUM_MEMBERS WHERE MEMBERS.M_NAME = 'Testing123'
Microsoft JET Database Engine error '80040e10'

No value given for one or more required parameters.

line 85

<
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 05 June 2008 :  10:40:33  Show Profile
That's correct; SQL uses single quotation marks. Just having a look at the rest of the query for any problems ...

<edit>OK, I'm going to combine the 2 queries into one for you, save you a db hit but I'll need to know the structure of the usergroups table.</edit>

<

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.”

Edited by - Shaggy on 05 June 2008 10:44:11
Go to Top of Page

Carefree
Advanced Member

Philippines
4222 Posts

Posted - 05 June 2008 :  10:53:01  Show Profile
Thanks, Shaggy. I started drinking but coffee's not making me relax.

Only four fields, all of which are integers with zero decimal places:

USERGROUP_ID
MEMBER_ID
MEMBER_TYPE
ORIGINAL_ID

<
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 05 June 2008 :  12:04:17  Show Profile
Give this a whirl:
if request.form("Method_Type")="Release" then
	strSql=	"SELECT U.USERGROUP_ID,M.MEMBER_ID,U.MEMBER_TYPE,U.ORIGINAL_ID "&_
		"FROM "&strTablePrefix&"USERGROUP_USERS U,"&strMemberTablePrefix&"MEMBERS M "&_
		"WHERE M.M_NAME='"&chkstring(request.form("RPrisoner"),"sqlstring")&"' "
		"AND U.MEMBER_ID=M.MEMBER_ID"
	set objRs=my_conn.execute(strSql)
	'do stuff
	objRs.close:set objrs=nothing
	'do more stuff
end if
<

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

Carefree
Advanced Member

Philippines
4222 Posts

Posted - 05 June 2008 :  13:18:53  Show Profile
I didn't get any values on Member_ID, so I added in some Responses

if request.form("Method_Type")="Release" then
	strSql=	"SELECT U.USERGROUP_ID,M.MEMBER_ID,U.MEMBER_TYPE,U.ORIGINAL_ID "&_
		"FROM "&strTablePrefix&"USERGROUP_USERS U,"&strMemberTablePrefix&"MEMBERS M "&_
		"WHERE M.M_NAME='"&chkstring(request.form("RPrisoner"),"sqlstring")&"' "&_
		"AND U.MEMBER_ID=M.MEMBER_ID"
	set objRs=my_conn.execute(strSql)
	RPRISON_ID = MEMBER_ID
	Response.Write	"<br>MEMBER_ID = " & RPRISON_ID & "<br>"
	Response.Write	strSql
	objRs.close:set objrs=nothing
	strSQL = "UPDATE " & strTablePrefix & "USERGROUP_USERS SET USERGROUP_ID = '" & ORIGINAL_ID & "', MEMBER_ID = '" & RPRISON_ID & "', MEMBER_TYPE = 1 WHERE MEMBER_ID = '" & RPRISON_ID & "'"
	Response.Write	strSql


quote:

MEMBER_ID =
SELECT U.USERGROUP_ID,M.MEMBER_ID,U.MEMBER_TYPE,U.ORIGINAL_ID FROM FORUM_USERGROUP_USERS U,FORUM_MEMBERS M WHERE M.M_NAME='Testing123' AND U.MEMBER_ID=M.MEMBER_IDUPDATE FORUM_USERGROUP_USERS SET USERGROUP_ID = '', MEMBER_ID = '', MEMBER_TYPE = 1 WHERE MEMBER_ID = ''



No error message - but no value to MEMBER_ID, same thing I was getting earlier. Dead in the water again.<
Go to Top of Page

Carefree
Advanced Member

Philippines
4222 Posts

Posted - 05 June 2008 :  13:28:04  Show Profile
That last one was hard to read, so I redid a couple lines:

	strSql=	"SELECT U.USERGROUP_ID,M.MEMBER_ID,U.MEMBER_TYPE,U.ORIGINAL_ID "&_
		"FROM "&strTablePrefix&"USERGROUP_USERS U,"&strMemberTablePrefix&"MEMBERS M "&_
		"WHERE M.M_NAME='"&chkstring(request.form("RPrisoner"),"sqlstring")&"' "&_
		"AND U.MEMBER_ID=M.MEMBER_ID"
	set objRs=my_conn.execute(strSql)
	RPRISON_ID = MEMBER_ID
	Response.Write	strSql
	Response.Write	"<br>MEMBER_ID = " & RPRISON_ID & "<br>"
	objRs.close:set objrs=nothing
	strSQL = "UPDATE " & strTablePrefix & "USERGROUP_USERS U, SET U.USERGROUP_ID = U.ORIGINAL_ID, U.MEMBER_ID = RPRISON_ID, U.MEMBER_TYPE = 1 WHERE U.MEMBER_ID = " & RPRISON_ID
	Response.Write	strSql

quote:

SELECT U.USERGROUP_ID,M.MEMBER_ID,U.MEMBER_TYPE,U.ORIGINAL_ID FROM FORUM_USERGROUP_USERS U,FORUM_MEMBERS M WHERE M.M_NAME='Testing123' AND U.MEMBER_ID=M.MEMBER_ID
MEMBER_ID =
UPDATE FORUM_USERGROUP_USERS U, SET U.USERGROUP_ID = U.ORIGINAL_ID, U.MEMBER_ID = RPRISON_ID, U.MEMBER_TYPE = 1 WHERE U.MEMBER_ID =



No value being passed to the Member IDs.<
Go to Top of Page

Carefree
Advanced Member

Philippines
4222 Posts

Posted - 05 June 2008 :  13:40:40  Show Profile
I figured out what I missed.

RPRISON_ID = objRs("MEMBER_ID")

So it's giving me a member ID and maybe I can finally finish this thing.

Thanks again, Shaggy<
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20600 Posts

Posted - 05 June 2008 :  13:44:49  Show Profile  Visit HuwR's Homepage
you don't get a value for MEMBER_ID because you never give it one

try


strSql= "SELECT M.MEMBER_ID AS MemberId "&_
"FROM "&strTablePrefix&"USERGROUP_USERS U,"&strMemberTablePrefix&"MEMBERS M "&_
"WHERE M.M_NAME='"&chkstring(request.form("RPrisoner"),"sqlstring")&"' "&_
"AND U.MEMBER_ID=M.MEMBER_ID"
set objRs=my_conn.execute(strSql)
RPRISON_ID = objRs("MemberId")
Response.Write strSql
Response.Write "<br>MEMBER_ID = " & RPRISON_ID & "<br>"
objRs.close:set objrs=nothing
strSQL = "UPDATE " & strTablePrefix & "USERGROUP_USERS U, SET U.USERGROUP_ID = U.ORIGINAL_ID, U.MEMBER_ID = RPRISON_ID, U.MEMBER_TYPE = 1 WHERE U.MEMBER_ID = " & RPRISON_ID
Response.Write strSql
<
Go to Top of Page

Carefree
Advanced Member

Philippines
4222 Posts

Posted - 05 June 2008 :  15:08:26  Show Profile
I have it working 100% now, Huwr; thanks to everyone who helped out.
If anyone's interested in the project, I'll package it for SB.<
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 06 June 2008 :  04:27:38  Show Profile
You could save yourself a chunk of code and another db hist by using the following code instead:
strSQL=	"UPDATE "&strTablePrefix&"USERGROUP_USERS "&_
	"SET USERGROUP_ID=ORIGINAL_ID, MEMBER_TYPE=1 "&_
	"WHERE MEMBER_ID=(SELECT MEMBER_ID FROM "&strMemberTablePrefix&"MEMBERS "&_
	"WHERE M_NAME='"&chkstring(request.form("RPrisoner"),"sqlstring")&"')"
my_conn.execute(strSql),,adCmdText+adExecuteNoRecords
<

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

Carefree
Advanced Member

Philippines
4222 Posts

Posted - 06 June 2008 :  06:15:33  Show Profile
Nice clean code, Shaggy. Now if I can avoid making it too cumbersome when I add Email selection to that routine since there are two automatic Emails generated by either action.<
Go to Top of Page
Page: of 3 Previous Topic Topic Next Topic  
Previous 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.34 seconds. Powered By: Snitz Forums 2000 Version 3.4.07