How to Show AccountExpires (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


winter -> How to Show AccountExpires (5/4/2008 18:52:14)

Hi – using FP2003 + the Dev Version of the Spooky Login System, I am trying to set up a page where users can view their other account records associated with the login system. The page is password protected. I have been able to show the session variable for x_FirstName, X_Lastname etc. but the one that just won’t work is a session variable that would show when the account is expired. I am using this bit of code: <%=Session("AccountExpires")%>

In the admin panel for the login, each member record expirary date is set manually. It’s not linked to a pay pal feature.

I tried using the DRW with the login db, and the Spooky Diet, adding:
fp_sQry="SELECT * FROM Users WHERE (UserID='"&Session("UserID")&"')"
,,, and selecting “accountexpires” for a result, but only get a DRW error.

Am I missing something or is it more complicated than this?

Help would be very appreciated!
[8|]




Spooky -> RE: How to Show AccountExpires (5/4/2008 18:57:53)

What is the DRW error you get? It is a date field, so you would have to use date delimiters - either ' or #




winter -> RE: How to Show AccountExpires (5/4/2008 23:26:14)

Hi Spooky - thanks so much for helping!

Here is the DRW code - which i am not sure where the delimiters go.

<!--#include file="../_fpclass/fpdblib.inc"-->
<%
fp_sQry="SELECT * FROM Users WHERE (UserID='"&Session("UserID")&"')"
fp_sDefault=""
fp_sNoRecords="<tr><td colspan=2 align=""LEFT"" width=""100%"">No records returned.</td></tr>"
fp_sDataConn="HRALogin"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&UserID=3&x_Firstname=202...the usual thing in here
fp_iDisplayCols=2
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="../_fpclass/fpdbrgn1.inc"-->
<tr>
<td>
<%=FP_FieldVal(fp_rs,"ActiveAccount")%></td>
<td>
<%=FP_FieldVal(fp_rs,"AccountExpires")%></td>
</tr>
<!--#include file="../_fpclass/fpdbrgn2.inc"-->
</tbody>
</table>
<p> </p>
<p> </div>


This is the error message That I get:

ActiveAccount AccountExpires
Database Results Wizard Error
The operation failed. If this continues, please contact your server administrator.

Do you mean to put the ' or # somewhere in this part of the code?...
<%=FP_FieldVal(fp_rs,"AccountExpires")%>

I will play with this.

Thanks so much!

Carolyn




winter -> RE: How to Show AccountExpires (5/4/2008 23:43:05)

quote:

<%=FP_FieldVal(fp_rs,"ActiveAccount")%>



For the DRW code in the last post I tried amending the "Account Active" part this way...

<%=FP_FieldVal(fp_rs,'"AccountExpires"')%>
<%=FP_FieldVal(fp_rs,#"AccountExpires"#)%> .. and I also tried putting the delimiters outside the brackets but i still get the error message.

hmmm... will sleep on this. Other ideas very welcomed!

Thanks again.

Carolyn




Spooky -> RE: How to Show AccountExpires (5/5/2008 2:37:45)

<%=FP_FieldVal(fp_rs,'"AccountExpires"')%> should be sufficient - really need to see the error thats created.
To see that, turn debugging off as in this post :

http://www.frontpagewebmaster.com/m-175524/tm.htm




winter -> RE: How to Show AccountExpires (5/5/2008 9:52:27)

quote:

<%=FP_FieldVal(fp_rs,'"AccountExpires"')%>


HI Spooky, - I did as you suggested and turned debugging to True. And copied and pasted the code exactly as you have it. The error message now reads...

---------------------------------^


Microsoft VBScript compilation error '800a03ea'

Syntax error

/membership/myaccount2.asp, line 281

Response.Write(FP_FieldVal(fp_rs,'"AccountExpires"'))
---------------------------------^

it must be a space or something?

Thanks so much! [8|]




BeTheBall -> RE: How to Show AccountExpires (5/5/2008 10:23:35)

The single quotes shouldn't be there.

Response.Write(FP_FieldVal(fp_rs,"AccountExpires"))




Spooky -> RE: How to Show AccountExpires (5/5/2008 15:22:15)

Ooops, I copied your code [:@] As Duane says, no quotes.
However you were having a DRW error before that, does it reappear without the quotes?




winter -> RE: How to Show AccountExpires (5/5/2008 19:42:48)

Thanks Duane and Spooky,

I originally started out with just double quotes, then added single, now removed the single quotes.

I tried it out again on a fresh page with just this DRW and the code you have suggested which actually does get generated by the wizard.


Here is the sample page I am using with the newest error message:
http://www.hramembers.org/test55.asp

And where this code appears in the DRW:
<%=FP_FieldVal(fp_rs,"AccountExpires")%>

U/p: test/test

Do I need to switch something on for this variable in the system settings somewhere?

Ideas very appreciated!

Thanks

Carolyn






BeTheBall -> RE: How to Show AccountExpires (5/5/2008 19:54:14)

Lose the single quotes in your SQL. I assume UserID is numeric. If so, this:

SELECT * FROM Users WHERE (UserID='"&Session("UserID")&"')

should be:

SELECT * FROM Users WHERE (UserID="&Session("UserID")&")




Spooky -> RE: How to Show AccountExpires (5/5/2008 20:22:07)

fp_sQry="SELECT * FROM Users WHERE UserID="&Session("UserID")




winter -> RE: How to Show AccountExpires (5/5/2008 20:37:00)

Hi Duane, - I tried the code you suggested:

quote:

SELECT * FROM Users WHERE (UserID="&Session("UserID")&")


... and still doesn't work as seen on the page http://www.hramembers.org/test55.asp

However, if I leave the sql statement alone, and use the DRW for the AccountExpires piece as on this page: http://www.hramembers.org/membership/myaccount2.asp ... you are able to access the page and all the other session variables show up, but the DRW for "AccountExpires" does not work. Scroll way down to the very bottom of the page where i was trying to test it. the slq statement is with the double and single quotes.

In the system settings, Access level values are recorded the same as the name of the level i.e. Certifed has a stored value of Certified. I may have done this when My knowledge of the Spooky Login system was at a grade 6 level as opposed to perhaps grade 9 or so now! Could this be the problem?


Thanks so much - I really appreciate your help!




winter -> RE: How to Show AccountExpires (5/5/2008 20:54:05)

quote:

fp_sQry="SELECT * FROM Users WHERE UserID="&Session("UserID")


I can't stop smiling! It works!!!!! Not only that... for a few seconds I was wondering ...well... why does it work?

Spooky from your earlier suggestion, I am concluding the a single quote + double quote in the sql statment, means that it is putting a separator in between 2 or more things? IF that is the answer, - I think I really get it.

My thanks to both of you! This is wonderful! It works!

With appreciation

Carolyn




Spooky -> RE: How to Show AccountExpires (5/5/2008 20:55:08)

You may be working on it now? the top link seems to work?




winter -> RE: How to Show AccountExpires (5/5/2008 20:58:54)

Yes! - BOth links now work! I guess the problem all along was the sql statment. I need to do more reading somewhere to get a better grip on this. I make my way around by just guessing! Copying and pasting and the Sesame Street process called "which of these things are not like the other"

http://www.hramembers.org/membership/myaccount2.asp?

http://www.hramembers.org/test55.asp

[:)][:)][:)]




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.125