Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 I have a Great idea!
 New Topic  Topic Locked
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 5

gor
Retired Admin

Netherlands
5511 Posts

Posted - 16 March 2001 :  16:02:09  Show Profile  Visit gor's Homepage
There only will be something displayed if MODE = display.

So if the page is called test.asp stored in the forum directory at http://www.myserver.com/ you would need to use:

http://www.myserver.com/forum/test.asp?mode=display


This is because the complete code is inside the SELECT CASE...END SELECT statement.



Pierre
Go to Top of Page

Freeman II
Junior Member

232 Posts

Posted - 16 March 2001 :  16:32:13  Show Profile
ok thats solved, but i still get the same error message when i run it.
------------------------
Hmm, strange, are you sure you're not opening another connection ?
This strConnString points to a database called snitz_forums_2000.mbd but the error says it was looking for a database called FORUM_MEMBERS.mdb
Can you see if that is somewere in the code ?


------------------------------
i don;t think so because i can still post in the forums.
---------------------------------
strsql = strsql & ", " & trMemberTablePrefix & "MEMBERS.M_GOLD "
------------------------
maybe thats the problem?
i tried to move that line up a few lines.
when i run it i get this error msg
---------------------------------

Error Type:
Microsoft JET Database Engine (0x80040E10)
No value given for one or more required parameters.
---------------------------------
'## Forum_SQL
strSql = "SELECT " & strMemberTablePrefix & "MEMBERS.MEMBER_ID, " & strMemberTablePrefix & "MEMBERS.M_NAME "
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_USERNAME, " & strMemberTablePrefix & "MEMBERS.M_EMAIL "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_FIRSTNAME, " & strMemberTablePrefix & "MEMBERS.M_LASTNAME "
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_TITLE"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_PASSWORD"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_ICQ"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_YAHOO"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_AIM"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_COUNTRY "
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_POSTS"
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_CITY "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_STATE "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_COUNTRY "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_POSTS "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_GOLD "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_HIDE_EMAIL "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_DATE "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_PHOTO_URL "
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_HOMEPAGE"
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_LINK1, " & strMemberTablePrefix & "MEMBERS.M_LINK2 "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_AGE, " & strMemberTablePrefix & "MEMBERS.M_MARSTATUS "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_SEX, " & strMemberTablePrefix & "MEMBERS.M_OCCUPATION "
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_SIG"
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_HOBBIES, " & strMemberTablePrefix & "MEMBERS.M_LNEWS "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_QUOTE, " & strMemberTablePrefix & "MEMBERS.M_BIO "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "





Edited by - Freeman II on 16 March 2001 16:32:57

Edited by - Freeman II on 16 March 2001 16:34:43
Go to Top of Page

Freeman II
Junior Member

232 Posts

Posted - 16 March 2001 :  17:59:08  Show Profile
ok forget about all the questions above.

do you know what this error message means?

Error Type:
Microsoft JET Database Engine (0x80040E10)
No value given for one or more required parameters.
/forum2/test.asp, line 43

thx

Go to Top of Page

gor
Retired Admin

Netherlands
5511 Posts

Posted - 16 March 2001 :  18:20:26  Show Profile  Visit gor's Homepage
nope, not without knowing what is on that line.

If that lines tries to execute an insert, make sure that you have added a value for each field in the insert.

Pierre
Go to Top of Page

Freeman II
Junior Member

232 Posts

Posted - 16 March 2001 :  18:27:45  Show Profile
heres line 43:

set rs = my_Conn.Execute (strSql)


the problem is really strange.
if i wait 5 mins and refresh the page, no error msg, but still doesnot read from the database. but if irefresh it again, the error msg shows up.


Edited by - Freeman II on 16 March 2001 18:31:37
Go to Top of Page

gor
Retired Admin

Netherlands
5511 Posts

Posted - 16 March 2001 :  18:33:57  Show Profile  Visit gor's Homepage
Sorry, should have explained myself better: since this line executes a SQL statement, I need to know what the strSQl variable-contents is that gets executed.

Pierre
Go to Top of Page

Freeman II
Junior Member

232 Posts

Posted - 16 March 2001 :  18:50:54  Show Profile
'## Forum_SQL
strSql = "SELECT " & strMemberTablePrefix & "MEMBERS.MEMBER_ID, " & strMemberTablePrefix & "MEMBERS.M_NAME "
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_USERNAME, " & strMemberTablePrefix & "MEMBERS.M_EMAIL "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_FIRSTNAME, " & strMemberTablePrefix & "MEMBERS.M_LASTNAME "
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_TITLE"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_ICQ"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_YAHOO"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_AIM"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_COUNTRY "
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_POSTS"
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_CITY "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_STATE "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_COUNTRY "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_POSTS "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_GOLD "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_HIDE_EMAIL "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_DATE "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_PHOTO_URL "
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_HOMEPAGE"
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_LINK1, " & strMemberTablePrefix & "MEMBERS.M_LINK2 "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_AGE, " & strMemberTablePrefix & "MEMBERS.M_MARSTATUS "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_SEX, " & strMemberTablePrefix & "MEMBERS.M_OCCUPATION "
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_SIG"
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_HOBBIES, " & strMemberTablePrefix & "MEMBERS.M_LNEWS "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_QUOTE, " & strMemberTablePrefix & "MEMBERS.M_BIO "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "


i copied that from pop_profile.asp
----------------------------------
this is what i use to display the data
<td align=center>You have <b><% =ChkString(rs("M_GOLD")) %>
gold</b></td>
--------------------------

at the end of the page i have

<%

rs.close
set rs = nothing
my_Conn.close
set my_Conn = nothing

%><!--#INCLUDE FILE="inc_footer.asp" --><% end if %>

Go to Top of Page

Freeman II
Junior Member

232 Posts

Posted - 16 March 2001 :  19:18:32  Show Profile
could you please take a look at my file, it;s really short.
http://www.geocities.com/scfff2/game1_main.txt

all i want to do is read the numbers from M_GOLD.(i created 4 new columns in the FORUM_MEMBERS table, and one of them is M_GOLD)

Thanks

Go to Top of Page

Freeman II
Junior Member

232 Posts

Posted - 16 March 2001 :  22:49:59  Show Profile
LOL i fixed it it turned out to be i linked to the wrong database,

anywayz the new problem is 'ChkString' can you tell me what that means?>

Error Type:
Microsoft VBScript runtime (0x800A01C2)
Wrong number of arguments or invalid property assignment: 'ChkString'
/forum2/game1_main.asp, line 74

Go to Top of Page

Freeman II
Junior Member

232 Posts

Posted - 16 March 2001 :  23:58:22  Show Profile
ok forget about all that
everything is fixed now

thanks a lot gor

Go to Top of Page

gor
Retired Admin

Netherlands
5511 Posts

Posted - 17 March 2001 :  00:45:28  Show Profile  Visit gor's Homepage
You're welcome, it looks like you're getting the hang of it, I didn't see the last 3 replies (because I had gone to bed) before you allready answered them yourself

Pierre
Go to Top of Page

Freeman II
Junior Member

232 Posts

Posted - 17 March 2001 :  23:16:32  Show Profile
gor sorry to bother you again.
how do it read the data of a specific user from the database?

now i use this code:



strSql = "SELECT " & strMemberTablePrefix & "MEMBERS.MEMBER_ID, " & strMemberTablePrefix & "MEMBERS.M_NAME "



but it doesn;t work, it only reads the first row (the first member).

thanks



Edited by - Freeman II on 18 March 2001 00:06:00
Go to Top of Page

gor
Retired Admin

Netherlands
5511 Posts

Posted - 18 March 2001 :  03:06:38  Show Profile  Visit gor's Homepage
No problem, though I'm going to move the topic to the Code Support forum after replying, because it doesn't belong in the W/O Code forum anymore (way to much code in here ) but isn't a MOD With Code either yet.

you can find an example of retrieving a single user based on the MEMBER_ID that is passed like test.asp?id=ZZZZZZ in pop_profile.asp:

'## Forum_SQL
strSql = "SELECT " & strMemberTablePrefix & "MEMBERS.MEMBER_ID, " & strMemberTablePrefix & "MEMBERS.M_NAME "
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_USERNAME, " & strMemberTablePrefix & "MEMBERS.M_EMAIL "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_FIRSTNAME, " & strMemberTablePrefix & "MEMBERS.M_LASTNAME "
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_TITLE"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_PASSWORD"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_ICQ"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_YAHOO"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_AIM"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_COUNTRY "
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_POSTS"
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_CITY "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_STATE "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_COUNTRY "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_POSTS "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_HIDE_EMAIL "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_DATE "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_PHOTO_URL "
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_HOMEPAGE"
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_LINK1, " & strMemberTablePrefix & "MEMBERS.M_LINK2 "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_AGE, " & strMemberTablePrefix & "MEMBERS.M_MARSTATUS "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_SEX, " & strMemberTablePrefix & "MEMBERS.M_OCCUPATION "
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_SIG"
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_HOBBIES, " & strMemberTablePrefix & "MEMBERS.M_LNEWS "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_QUOTE, " & strMemberTablePrefix & "MEMBERS.M_BIO "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & " WHERE MEMBER_ID=" & Request.QueryString("id")

set rs = my_Conn.Execute(strSql)

strMyHobbies = rs("M_HOBBIES")
strMyLNews = rs("M_LNEWS")
strMyQuote = rs("M_QUOTE")
strMyBio = rs("M_BIO")


Two things to note: Hobbies/News/Quote/Bio are the last fields retrieved in the sql statement, that is because they are MEMO (or in Sql Server TEXT) fields.
They also are stored in a variable because otherwise the sometimes happened to be unaccessable.

Pierre
Go to Top of Page

Freeman II
Junior Member

232 Posts

Posted - 19 March 2001 :  19:58:35  Show Profile
I think the way test.asp?id=ZZZZZZ is used is kinda unsecure?
it's displayed on the address bar of your browser and it can be easily changed, example: my id is 7 i changed it to test.asp?id=8, then it;s gonna show member_id8's info.
is there anyway i can make users to read only their own info?
thx

Go to Top of Page

gor
Retired Admin

Netherlands
5511 Posts

Posted - 20 March 2001 :  02:39:10  Show Profile  Visit gor's Homepage
If that is what you want, take a look at how the Profile link works for editing your profile here at the site.
If you use that for display, then you can be sure only the user itself or an administrator can view the profile.

Pierre
Go to Top of Page
Page: of 5 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.34 seconds. Powered By: Snitz Forums 2000 Version 3.4.07