CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Session Help, Please

Print topic Send  topic

Author Message
Joe
Posted: 05/28/2004, 8:15 AM

I have a login table(Table Name: Information) which has the following fields:
1)Usr_ID
2)Usr_Name
3)Usr_Pass
4)Usr_SCAC
=============================
Problem:
When the user logins, They login with only Usr_Name and Usr_Pass, after login, it redirect to page, but on the page i need to display Usr_SCAC, in a form field, i know i need to create some kind of session, but i do not know what, any help is great, Thanks
peterr


Posts: 5971
Posted: 05/28/2004, 11:41 AM

When users login, the program automatically creates the "UserID" session, which then can be used on other pages. Therefore in your case you could use the "CCDLookup" function as the default value of any field (on any form or page) to lookup the value based on the UserID session. For example in teh "Default" property enter:
CCDLookup("Usr_SCAC","users","Usr_ID=" & Session("UserID"), DBConnection1)

(DBConnection1 is the prefix "DB" + the name of your connection)
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Joe
Posted: 05/28/2004, 1:10 PM

Peter, Thanks, But i have a problem
Do i have to have a field on my database name UserID, cuz i have one called Usr_ID which is a number autonumber field,
I am very confused:-/:-/:-/:-/
Thanks
peterr


Posts: 5971
Posted: 05/28/2004, 1:40 PM

Hi,

No, the "UserID" is created automatically and is always the same, regardless of your field name. In the above example you would only need to change "users" to your login/user table name and "Connection1" to your connection name.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Joe
Posted: 06/03/2004, 2:13 PM

PeterR

I get this error, When i put code in Before Show of texbox

Microsoft VBScript compilation error '800a0414'   
Cannot use parentheses when calling a Sub   
  
CCDLookup("Usr_SCAC","Information","Usr_ID=" & Session("UserID"), DBConnection1)  

And i get this error when i put it in the Default prop.

Source: CCDLookUp function  
Command Text: SELECT Usr_SCAC FROM Information WHERE Usr_ID=  
Error description: Syntax error (missing operator) in query expression 'Usr_ID='. (Microsoft JET Database Engine)<br>  

Little Help, Thanks
peterr


Posts: 5971
Posted: 06/03/2004, 2:27 PM

The 1st error happens because CCDLookup is a function, therefore it cannot be called by itself without any purpose. You would need to use this function to return some value and assign that value somewhere. For example: FormName.FieldName.Value = CCDLookup...

The 2nd problem probably happens because no one is logged in. You could add an IF statement to check if Session("UserID")<>"" and then call the function.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
test only
Posted: 06/06/2004, 7:48 AM

:*):-O;-):-|:-(:-<

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.