Show Only Records From Session("username")

Jun 15, 2005

Hello all.

I'm new to Asp and i'm working on a RMA application, now i want to show only the records that belong to the user that is logged in. I have the following code but is isn't working can somebody tell me what i'm doing wrong?

<!--#include file='includes/dbconnection.inc'-->
<!--#include file='header.inc'-->
<!--#include file='includes/settings.asp'-->
<!--#include file='includes/title.asp'-->
<!--#include file='activeusers.asp'-->
<% If Session("userAdmin") = 1 then %>
<!--#include file='includes/adminmenu.inc'-->
<% Else %>
<!--#include file='includes/usersmenu.inc'-->
<% End If %>
<%
If Session("userGood") = False or IsNull(Session("userGood")) = True then
Response.Redirect"default.asp"
End If
strUserName = Replace(Session("userName"), "'", "''")
userID = Clng(Session("userID"))
userAdmin = Replace(Session("userAdmin"), "'", "''")
Session("userID") = userID
%>
&nbsp;<p align="center"><font size="4" color="#000080"><b>W</b></font><b><font size="4"

color="#000080">Welcome </font>
<font size="4" color="#0000FF"> <%Response.Write(Session("username"))%></font><font

size="4" color="#000080"> text bla bla bla</font></b></p>
<center><table><tr><td>&nbsp;</td></tr></table></center>
<html>
<body>

<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open(Server.Mappath("db/login.mdb"))
set rs = Server.CreateObject("ADODB.recordset")
rs.Open ""SELECT * FROM tblUsers WHERE tblusers.username = '" & Session("username") & "'

do until rs.EOF
for each x in rs.Fields
Response.Write(x.name)
Response.Write(" = ")
Response.Write(x.value & "<br />")
next
Response.Write("<br />")
rs.MoveNext
loop

rs.close
conn.close
%>

</body>
</html>
<!--#include file='footer.inc'-->

View Replies


ADVERTISEMENT

Queries :: Time Query - Show Transactions For Particular Session

Jul 20, 2015

I have a pop up reports tied to my form so the usere can press the see list report of all the equipment they just scanned in or out of the building. I am useing the Date/Time data type (General Date) What I would like to get out of the query is when the user clicks the button it will show all entries from the time right before the button is pressed AND through 5 minutes earlier. (That would be the time that the user would of started scanning the equipment.

This is my current criteria : Between Now() And Date()

This is returning all transactions for the day. I really only want all transactions for that session.

View 3 Replies View Related

Show Username When Textbox Dblclick

Sep 24, 2014

I am looking for a way to display a windows login name when the user double clicks on a text box. This is for a digital signature on a form that I don't want people having access to just type in some elses name.

View 3 Replies View Related

Session Ending

Dec 29, 2004

Can I let a Session variable end when all the pages are closed?

View 1 Replies View Related

Can't Open Mail Session

Feb 25, 2008

I use Access to e-mail advice reports to my project managers. I have done this for many months using a macro "sendobject". For some reason this week I get the message "Can't Open Mail Session". When I look at the help note it says there might not be enough memory, close other applications but this is not the problem as I have nothing else open. I have tried it on another machine and still get the same message.

Any ideas?

Many thanks

View 4 Replies View Related

Select Statement With Like And A Session Variable

Oct 28, 2004

Can some one please help with my SQL statement. Having trouble with getting the like statement to work with my session variable.


Here's the code I am using thus far.

<% If Session("PhoneN") Then %>

<%

dim objcn1,objrst2,sql4


set objcn1 = Server.CreateObject("ADODB.Connection")
set objrst2 = Server.CreateObject("ADODB.RecordSet")

sql4 = "SELECT * FROM [Bill To Customers] WHERE CompanyPhone LIKE '%' & PhoneN & '%' "

View 3 Replies View Related

Retaining A Value Entered Throughtout The User's Session

Nov 13, 2006

I am creating a database to track a student's course load in a degree program.

When the student enteres their ID on the first form I want to retain that value so subsequent forms and views display their records, or allow new entries/updates to different tables without re-entering their ID. I'm having no luck passing the value entered into the first form's text box to other processes selected prior to closing out the database.

Thank you.

View 3 Replies View Related

General :: Student Database - Transfer Of Payment To New Semester And Session

Nov 18, 2012

I am creating a student database in ms access2007 but finding difficult to go further. In my database, I have created the following

Student-info-table
SemesterTable
SessionTable
PaymentTable

Then a query from the payment that shows student I'd,arrears,amount due,paid. And balance

My question is

1.How do I transfer the students and their balance to a new semester and session
2.Do I have to new student and payment tables every semester bcos payment are made every semester
3. I want to keep each students payment for as long as they remain in the school
4. A session is made up three semesters how do I transfer students to a new session

May be my tables layout are faulty...

View 1 Replies View Related

Modules & VBA :: Web Browser Control To Navigate A Website That Only Allows One Session At A Time

Oct 16, 2013

I have constructed an application in Access2010 that uses the ActiveX WebBrowser Control.I am using the Web Browser control to navigate a website that only allows one session at a time and normally (if using a regular web browser) if you close the tab you're working on, you have to completely close the browser and reopen it to be able to acces the website again.

I have this application on 2 networks.

On PC

A) when using the WebBrowser control I can navigate to the site. But if I need to navigate away or need to log in as a different account on the site, I can close an reopen the form and that will suffice to regain access to the site.

However on PC

B) it will not allow me to navigate back to the site by closing and reopening the form (the website recognises it is not a new session). I have to close the entire database and reopen it to get the site to work again.

I would very much like PC B) to be behaving in the same manner as PC A) so that I do not have to tell users to restart the whole database in order to reaccess the site.

View 1 Replies View Related

Qry Results Show Duplicate Records, Records Are Not Dup In Table.

Nov 16, 2004

I have built a qry that initially shows the correct information. For example.

tblContent has 289 records with a Type = Class.

I built a Query to select from tblContent Type = Class and I get 289 records. I add additional criteria of Progress <>"Not Scheduled", I then get 206 records. I then add additional criteria Last Name <>"Demo" And <>"Care" And <>"Support". This brings up 200 records, but the query appears to duplicate each record 3 times. I do not have 3 of the same types of records.

The SQL Statement is below

SELECT tblProfile.LoginName, tblProfile.FirstName, tblProfile.LastName, tblProfile.Organization, tblProfile.CostCenter, tblContent.Title, tblContent.Type, tblContent.Code, tblContent.[Date Assigned], tblContent.[Date Started], tblContent.[Last Accessed], tblContent.Progress, tblContent.[Date Completed]
FROM tblProfile INNER JOIN tblContent ON tblProfile.LoginName = tblContent.LoginName
WHERE (((tblProfile.LastName)<>"Demo" And (tblProfile.LastName)<>"Care" And (tblProfile.LastName)<>"Support") AND ((tblContent.Type)="Class") AND ((tblContent.Progress)<>"Not Scheduled"));

The qry is named qryPhysical Class. I have provided the link to view the database. Can you help me?

http://briefcase.yahoo.com/turnerbkgabrobins

Thank you in advance for your assistance.

View 1 Replies View Related

Tables :: Attendance Tracking System - Adding Hours For Each Student Enrolled In Class Session

Jul 12, 2013

I'm creating an attendance tracking system, the attendance system needs to : Allow an instructor to enroll students into one or more classes, and then add attendance by date to each class(es). The problem that I'm having is, attendance is tracked by the number of hours that a student attends class. For instance, if class1 is in session from 8a.m. - 12p.m. student1 may only stay 2.50 hours of that class and student2 may stay 3 hours. The teacher needs to be able to add attendance to class1 for July 12, 2013 and add hours for each student enrolled in this class session who attended on that day. I have the following so far, minus the attendance:

Students -This is just the basic demographic information that instructors will need to enter on students.
StudentID (PK)
StudentLastName
StudentFirstName
DateOfEnrollment
LevelOfStudy
DateOfBirth

Location - These are the locations in which our students can attend classes
LocationID (PK)
LocationName
County
City
LocationPhoneNumber
LocationFaxNumber

Classes - These are the classes that our students can attend.
CRNNo (PK)
ClassName
LocationID
InstructorID

Instructor - These are the instructors that teach our classes.
InstructorID (PK)
InstructorLastName
InstructorFirstName
InstructorEmailAddress

Enrollment - This table enrolls the student into a class
StudentID(PK)
CRNNo (PK)
LocationID (PK)

View 11 Replies View Related

Show Last 5 Records

Apr 26, 2006

Hi,

I have a table with an autonumber incremental ID field using the format 0000, 0001, 0002 all the way to 1530.
I'm trying to create a query that returns the last 5 records in decending order, so...

1530
1529
1528
1527
1526

any ideas?
Thanks.

View 2 Replies View Related

Only Show 10 Records In A Subform

Nov 8, 2007

Hi all

I have a subform which loads the items from a table the form is non editable just for viewing the items, the problem is how can i
A. limit the subform to only show the first say 10 items in the subform
B, to have a command button on the form where the the subform is on (command button not in the form) and when the user clicks it it goes to the next set of records say from 11 to 21 and displays that in the form.

i tried doing record cound but somehow record count is not there when selecting, also would the code go in the subfrom on load or on the form load where the subform is based?

any help on this would be appreciated.

thanks.

View 7 Replies View Related

Show Only Records From Last 7 Days?

Sep 14, 2005

This is fairly simple i think although i cant do it right i have a field in a query named; "shiftdates" which uses the format: DD/MM/YYYY, how can i set the criteria for this to only show records from the past 7 days?

i think i need something like: date()-7 (this doesnt work though), anyone help me out?, :o

View 4 Replies View Related

Show Number Of Records

Jul 26, 2006

Hi everyone

My problem goes as followed:

As you can see in the picture there are 175 records currently showed. What I want to achieve is that this number is displayed in a Text Box.



Thanks in advance.

View 4 Replies View Related

How To Show Several Records In One Field

May 21, 2012

I have a table: Complaint

Within the table there is a field: CustomerID

There could be anywhere from 1 to 10 records with the same CustomerID.

I would like to show all the complaints for a specific CustomerID on a form in one field.

Right now I have the following Control Source Code:

=[Complaint.PartNumber] & ", ," & [Complaint.PNdescrip] & ", ," & [Complaint.Complaint]

This code will only display 1 record.

I would like the text box to look like this: (All from the same CustomerID number)

Part Number A PN Description A Complaint A
Part Number B PN Description B Complaint B

View 2 Replies View Related

Need Querry To Show Records That Are 3 Months Old

Aug 27, 2005

I have a querry designed to show loans that have a start date and an end date. I want my querry to show loans that have a start date, no end date, and that are 3 months old. Here is what I have so far but I can't figure out how to increment the 3 months on the start date:

SELECT Detail.CustomerID, Detail.TransactionID, Loan.LoanAmount, Loan.StartDate, Loan.EndDate, Loan.LoanLender
FROM Detail INNER JOIN Loan ON Detail.CustomerID = Loan.TransactionID
WHERE (((Loan.EndDate) Is Null))
WHERE ((( Loan.StartDate)) Is


Please help finish this line.

raydan

View 5 Replies View Related

Null Combo Box; Show All Records

Feb 11, 2006

Hello All,

I’m using a combo box for the criteria for a saved query. Is there any way to show all the records if the combo box value is either “0” or null?

Thanks,

View 4 Replies View Related

Show Records Only Where Date Is Within The Next Week?

May 26, 2006

Dear All, I have a field named: “reminder date” in a query and would like to show only records where the reminder date is within the next week whenever the query is run (ie if todays date is 26th may 2006 and I run the query now It would only show records that include the following dates 27,28,29,30,31, july and 1,2 June)

Ive tried the below bit of code but this shows to many records beyond one week.
>=DateAdd("d",+7,Date())

Anybody have any suggestions?

Regards

Jim

View 8 Replies View Related

Show Records With Unique Field

Jun 8, 2006

Hi,
I have two tables:
tblOutTransmittals and tblTransmittedDocs. A document is sent with a transmittal document which the recipient signs to confirm that they received it. I've created a query that will show all the drawings/documents and the information about the associated transmittals.

What I want to do is show display records with a unique CCNum and preferably the one with the most recent TransmittalDate.

I've attached a screenshot and here is the sql:
SELECT tblOutTransmittals.CCNum, tblTransmittedDocs.DrawingNum, tblTransmittedDocs.RevisionNum,tblOutTransmittals. *
FROM tblOutTransmittals INNER JOIN tblTransmittedDocs ON tblOutTransmittals.DocID = tblTransmittedDocs.outTransmittalID
WHERE tblTransmittedDocs.DrawingNum="32-35554"

I've tried it using the DISTINCT keyword but that would only work if I'm returning one field. I tried Group By as well but couldn't get that to work.

Thank you,
RCurtin

View 1 Replies View Related

Show Records By Week Per Month

Feb 20, 2007

Good day!

I'm planning to create a form that would show total number of sales transaction per week: If today's month is February, i would like users to see records like this: (Week should start on a Monday and ends on Saturday)

GroupNo______Week1_____Week2_____Week3____Week4___ _Week5___MTD
GroupA________12_________2__________10________11__ _____15_____50
GroupB_________8_________5___________7_________1__ _____21_____42

I can't find a sample code for this particular date criteria. :-(

Thanks in advance!


Sheila

View 6 Replies View Related

Query To Show Missing Records

Jan 24, 2008

I have a table for stock with two fields, KEY and DESCRIPTION; a table for manufacturers with two fields, KEY and NAME; and a third table which links to them both with a many-to-one join with three fields, KEY, STOCK-KEY and MFR-KEY. What I am trying to do is write a query that for a given manufacturer (entered via a parameter) shows a single line for all stock records that are NOT linked to it via the third table. I am sure it should be simple but all my attempts fail to exclude stock linked to the manufacturer if it is also linked to another manufacturer. Any ideas?

View 8 Replies View Related

Only Show Records Older Than 6 Months

Mar 3, 2008

Is there an expression to show records in a query that are older than 6 months?

At the moment I have to go into the database every month and change the criteria date ie:

<#01/09/2007#

It would be much easier if it could do this automatically with an expression.

Can anyone tell me if ones exists?

Thanks

View 9 Replies View Related

How Do I Only Show Current Records Image?

Oct 12, 2005

Hi

Just wondering if anyone could help me with my little problem :)

I am making a register (as in a class register of students) I have a table with the lessons on and one with students on. I have made a relationship between them etc.

I have a form where the parent allows you to choose which lesson you want to view, and the subform displays the students for that lesson. This all works fine.

My problem is that I also want a picture to be displayed for the student that is currently selected, I have managed to update the picture by using

Private Sub Form_Current()
[student_picture].Picture = [student_image]
End Sub

student_picture is the name of the image on the subform, the student_image is a row in my student database that contains the location of the image e.g. c:abc.jpg

and this works at updating the image that is show. The only problem is that the image is shown on all records/rows. Is there anyway of making it so that the image is only displayed on the current row?

Thank you

Neil

View 4 Replies View Related

Show Two Different Records From Same Record Source

Oct 12, 2006

Hi,

I am trying to create a textbox that will show a document number of the last record so when a user clicks add new document he/she knows what document number to enter in next. It must not involve the user looking a subform with the document numbers on it.

Thanks for your time,

Leon

View 2 Replies View Related

Show Only Certain Related Records In Combo Box

Oct 14, 2006

I have a feeling this is a common and probably easy question, but I couldn't find anything on it in the forums.

I have a main customer form with multiple subforms on it to keep track of my clients insurance policies and claims. I enter their contact data in the main form, and the policy data on one of the subforms. Then when they have a claim, I enter the policy information on the claim subform as well.

How could I have the combo boxes in the claims subform (which is storing data in a claims table) only show the policy numbers (stored in a policies table) assigned to that particular person? I would assume I need to somehow filter the policies query so it only shows records for that particular person, but I'm not sure how to do that on the fly.

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved