Expression > 論壇首頁 > Expression Web and SuperPreview > Retrieve Only Records Of UserName After User Log's-In
發問發問
 

已答覆Retrieve Only Records Of UserName After User Log's-In

  • 2008年7月31日 下午 03:00VonGriez 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     包含代碼
     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?

解答

  • 2008年8月1日 上午 07:00paladyn 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     已答覆
    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

    • 已標示為解答VonGriez 2008年9月1日 下午 08:00
    •  

所有回覆

  • 2008年7月31日 下午 03:20Mike EW版主使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    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

  • 2008年7月31日 下午 05:21Gregory A. Beamer - MVPMVP使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    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
  • 2008年7月31日 下午 09:38ClarkNK 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    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
  • 2008年8月1日 上午 07:00paladyn 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     已答覆
    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

    • 已標示為解答VonGriez 2008年9月1日 下午 08:00
    •  
  • 2009年1月6日 下午 02:01SandeepV 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    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!!!!!