Expression > Página principal de foros > Expression Web and SuperPreview > Retrieve Only Records Of UserName After User Log's-In
Formular una preguntaFormular una pregunta
 

RespondidaRetrieve Only Records Of UserName After User Log's-In

  • jueves, 31 de julio de 2008 15:00VonGriez Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     Tiene código
     Currently I’m working as a developer using Expression Web 2. I need help when a user logs-in with “User Name” and “Password” to retrieve only his/her records. I’m using Microsoft Access 2002-2003. Is there any templates or samples I may go to?

Respuestas

  • viernes, 01 de agosto de 2008 7:00paladyn Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     Respondida
    VonGriez said:

     Currently I’m working as a developer using Expression Web 2. I need help when a user logs-in with “User Name” and “Password” to retrieve only his/her records. I’m using Microsoft Access 2002-2003. Is there any templates or samples I may go to?

    Given that the user name and password have to be stored somewhere to be validated, I will presume that you have implemented a primary key on the table of user records containing the username/password combination for authorized users. If you have properly normalized your tables to 3NF, that primary key will also exist as a foreign key in all other tables which contain user information.

    For example, given a validation table ValTable with fields

    User_ID (Primary key, unique, usually a longint or a GUID)
    Name
    Password

    there will be associated tables such as Contacts, with fields

    Address_ID (Primary key)
    User_ID (Foreign key)
    Street
    City
    State
    ZIP

    and you can query the database with

    SELECT Street, City, State FROM Contacts
    WHERE Contacts.User_ID = ValTable.User_ID (this value would be passed as a parameter to the query)

    This is not the most rigorous example I've ever come up with off the top of my head, but hey, it's 3:00 AM; gimme a break. ;-) You will note that I have not attempted to conform to the syntax of a particular dialect of SQL, or to ensure that the example tables are 3NF. For example, for 3NF compliance, there would be no User_ID in the Contacts table, since it is possible that an address might be applicable to multiple contacts. Say, for instance, where several contacts work for the same company at the same location. In practice, the Address_ID would be a foreign key in a Users table, so that multiple users could point to the same address, and you would first query the Users table to get the Address_ID for that user (or create a compound query).

    The point is that, given that a user may be uniquely identified by his login information, and that your tables are correctly structured (i.e., in 3NF), retrieving the information associated with that user is simply a matter of structuring your database query appropriately.
     
    cheers,
    scott

    • Marcado como respuestaVonGriez lunes, 01 de septiembre de 2008 20:00
    •  

Todas las respuestas

  • jueves, 31 de julio de 2008 15:20Mike EWModeradorMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
    This is a tall order for Expression Web and really what you are trying to do is functionality of Sharepoint/Windows Sharepoint Services.
    While this can be done with alot of work and consulting. I don't know where to start on this, but it would certainly be using either alot of .NET or PHP.  With the amount of .NET you would be using, you would likely want to work with Visual Studio to create most of this.

    If your site is internal only you may want to consider WSS as a solution, where user based document viewing a part of how it works:

    http://www.microsoft.com/downloads/details.aspx?FamilyId=EF93E453-75F1-45DF-8C6F-4565E8549C2A&displaylang=en

  • jueves, 31 de julio de 2008 17:21Gregory A. Beamer - MVPMVPMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
    This really depends on how you have your database set up. If you have everything linked properly (foreign key constraints), you can fairly easily pull a dataset of the information you desire. It is not as easy to accomplish with drag and drop only, however.

    --
    Gregory A. Beamer
    MVP, MCP: +I, SE, SD, DBA

    Subscribe to my blog
    http://gregorybeamer.spaces.live.com/lists/feed.rss

    or just read it:
    http://gregorybeamer.spaces.live.com/


    Think outside the box
  • jueves, 31 de julio de 2008 21:38ClarkNK Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
    If you have asp.net available and

    If you are open to using the (free) Visual Web Developer 2008 (sister program to Expression) for the database work and

    If you are willing to do a little reading and

    If you are willing to buy a book to do the reading from, then it is easy to do.

    Buy "Sams Teach Yourself ASP.NET in 24 Hours by Scott Mitchell" then read the explanation on pages 596 - 599 and whatever background in the book leading up to that you need.

    This book is really valuable as it walks you completely through the process of setting up a functional database-driven membership website.

    And if you get into ASP.NET then also buy Jim Cheshires book "The Microsoft Expression Web Developers Guide to ASP.NET 3.5"  He goes into some issues people run into when trying to move their work from their desktop to their web hoster that Scott does not get into.



    CHO, HomePage Doctor http://www.homepagedoctor.com/ExpressionTutorials/Tutorials.htm
  • viernes, 01 de agosto de 2008 7:00paladyn Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     Respondida
    VonGriez said:

     Currently I’m working as a developer using Expression Web 2. I need help when a user logs-in with “User Name” and “Password” to retrieve only his/her records. I’m using Microsoft Access 2002-2003. Is there any templates or samples I may go to?

    Given that the user name and password have to be stored somewhere to be validated, I will presume that you have implemented a primary key on the table of user records containing the username/password combination for authorized users. If you have properly normalized your tables to 3NF, that primary key will also exist as a foreign key in all other tables which contain user information.

    For example, given a validation table ValTable with fields

    User_ID (Primary key, unique, usually a longint or a GUID)
    Name
    Password

    there will be associated tables such as Contacts, with fields

    Address_ID (Primary key)
    User_ID (Foreign key)
    Street
    City
    State
    ZIP

    and you can query the database with

    SELECT Street, City, State FROM Contacts
    WHERE Contacts.User_ID = ValTable.User_ID (this value would be passed as a parameter to the query)

    This is not the most rigorous example I've ever come up with off the top of my head, but hey, it's 3:00 AM; gimme a break. ;-) You will note that I have not attempted to conform to the syntax of a particular dialect of SQL, or to ensure that the example tables are 3NF. For example, for 3NF compliance, there would be no User_ID in the Contacts table, since it is possible that an address might be applicable to multiple contacts. Say, for instance, where several contacts work for the same company at the same location. In practice, the Address_ID would be a foreign key in a Users table, so that multiple users could point to the same address, and you would first query the Users table to get the Address_ID for that user (or create a compound query).

    The point is that, given that a user may be uniquely identified by his login information, and that your tables are correctly structured (i.e., in 3NF), retrieving the information associated with that user is simply a matter of structuring your database query appropriately.
     
    cheers,
    scott

    • Marcado como respuestaVonGriez lunes, 01 de septiembre de 2008 20:00
    •  
  • martes, 06 de enero de 2009 14:01SandeepV Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
    I too have the same problem....please help me out....

    i want to retrive data from the database and display it in a textbox.
    i tried it using the SQL query "select * from emp where emp.eid = client.eid"
    Names of the database :- emp (the primary key is set) and client (the foreign key is set)
    And then i have displayed it in a textBox. but the above query itself is not working!!!!!