Chat Room Construction detailed two

Source: Internet
Author: User
Tags expression mdb database access database
And then we start talking about the construction process, first of all, we want to plan, to have a general understanding of how many database tables should be used, what fields should be in these database tables; There are already several database tables in front of us: 1. User table for storing user information, 2, speaking table for storing speech information, 3, An online user table that stores online user information.
It is easy to use an access or SQL SERVER database to create an Access database, just as it is to create an Excel table, and you don't have to know too much about database knowledge.

We first set up Chat.mdb database contains user table and chat table: as follows:

User table:

ID IP name Sex password
. . . . .
. . . . .

Chat table:

ID IP name Color Expression Speech Object speak
. . . . . . .
. . . . . . .

Online User table:

ID Name Sex login time
. . . .
. . . .

Once the database is established, we can start to program, first of all to consider the establishment of the following independent documents: 1, landing and speaking areas, 2, refresh the area 3, the district.

First look at the landing and speaking area: This is the core part of the chat room, please see the process first:

            

Landing < ——————————— |
| |
| |
Get user name, User IP, password |
| |
| |
| |
| Password Error |
| —————————— query user Table —————————— |
| Correct password |
| |
| Early |
| Times |
| Camden |
| Lu |
| |
| |
| Write user name, User IP, and password to user table
| |
| |
| ———— > Write user name and login time to online user table
|
|
| —————————--> Speaking Area
| |
| |
| Election |
| Choice | choice
| Yan | said
| color | words
| with | the
| Table | to
| Feeling | like
| |
| |
| Speak
| |
| |
| The name, the content of the speech, the object of speech,
| The color, the expression writes the chat table
| |
| |
|        Speaking | Leave
|-———————————— | ———————————— |
|
|
|
|<-——————————— |
|
|
Remove the user from the Online user table
|
|
|
Leave the chat room


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.