给网页建立一个简单的access数据库
打开Microsoft Access,选择 文件 -〉新建数据库,然后选择一个位置保存你的数据库文件,这里我们按它默认的db1.mdb命名保存。 保存数据库后我们看到的是下面的界面,双击使用设计器创建表,开始创建一个数据表。我们这里的应用你只需照着步骤一步步做下去,
打开Microsoft Access,选择 文件 -〉新建数据库,然后选择一个位置保存你的数据库文件,这里我们按它默认的db1.mdb命名保存。
保存数据库后我们看到的是下面的界面,双击使用设计器创建表,开始创建一个数据表。我们这里的应用你只需照着步骤一步步做下去,即使你以前从没接触过数据库也没有问题,如果你想做深层次的应用,涉及到关系结构的话,那最好还是找一本数据库的书来看看。

接下来我们设计一个用户注册用的用户信息表。双击 使用设计器创建表,打开设计界面。在字段名称一栏中填入你想纪录的用户信息(最好字段名不要用中文来命名,这样以后编程的时候不会有太多麻烦,同时也要注意不要用到了数据库自己的保留字---比如temp,这样的话和数据库程序会有冲突,尽量用表名+下滑线+名称的方式来命名,比如tbl_userinfo_name,这里我们先用简单的命名处理)。我们共创建了6个字段,分别为username(保存用户注册的id)、userpass(用户注册用的密码)、usermail(用户的电子邮件地址)、reg_date(用户注册时间)、homepage(用户的个人主页地址)、phone(用户的联系电话)。数据类型形用它默认的文本类型,字段大小为50,先面我们再来对个别字段进行处理。
一般来讲,用户名、密码、电子邮件地址、联系电话号码都不会超过50个字符(当然,如果有人恶意输入过长的字符串的话会报错,所以我们在后面的网页制作中要做一些限制),而个人主页地址呢,则可能超过---如http://www.netease.com/~cosix/html/......,所以我们将它的字段大小调整为200。

注册日期的时间类型改为 日期/时间,*_’ 当然嘛。然后我们可以调用access自己的函数功能为他添加一个默认值, =Now() ,这表示当数据添加时,数据库系统自动以服务器当前时间作为reg_date字段的值,这样我们就可以省去在网页中制作输入注册日期的一步了。

修改完毕之后,点击工具栏上的保存图表保存我们的新创建的表,这是会跳出一个警告对话框,告诉你表尚未定义主键。没有主键的话就不能确定这记录在表中的唯一地位,这样在删除或者编辑纪录的时候就会搞错,所以我们要创建一个主键。主键的值是不会重复的。点击是,创建主键。

如图,创建了一个名叫ID的主键(旁边有个钥匙图标的),数据类型为自动编号。

在点击保存,这次要你输入保存的表的名称,我们以userinfo命名。

一个表就创建好了!是不是很简单?

因为我们还没学到怎么制作添加纪录的内容,所以这里我们就手动添加一些内容进去,便于我们待会儿进行的测试。如图。

好,一个完整的数据库就建立起来了,下一步做什么呢,嗯,且听下回分解。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

MySQL is an open source relational database management system, mainly used to store and retrieve data quickly and reliably. Its working principle includes client requests, query resolution, execution of queries and return results. Examples of usage include creating tables, inserting and querying data, and advanced features such as JOIN operations. Common errors involve SQL syntax, data types, and permissions, and optimization suggestions include the use of indexes, optimized queries, and partitioning of tables.

MySQL is chosen for its performance, reliability, ease of use, and community support. 1.MySQL provides efficient data storage and retrieval functions, supporting multiple data types and advanced query operations. 2. Adopt client-server architecture and multiple storage engines to support transaction and query optimization. 3. Easy to use, supports a variety of operating systems and programming languages. 4. Have strong community support and provide rich resources and solutions.

How to configure Zend in Apache? The steps to configure Zend Framework in an Apache Web Server are as follows: Install Zend Framework and extract it into the Web Server directory. Create a .htaccess file. Create the Zend application directory and add the index.php file. Configure the Zend application (application.ini). Restart the Apache Web server.

This article will explain how to improve website performance by analyzing Apache logs under the Debian system. 1. Log Analysis Basics Apache log records the detailed information of all HTTP requests, including IP address, timestamp, request URL, HTTP method and response code. In Debian systems, these logs are usually located in the /var/log/apache2/access.log and /var/log/apache2/error.log directories. Understanding the log structure is the first step in effective analysis. 2. Log analysis tool You can use a variety of tools to analyze Apache logs: Command line tools: grep, awk, sed and other command line tools.

Apache server is a powerful web server software that acts as a bridge between browsers and website servers. 1. It handles HTTP requests and returns web page content based on requests; 2. Modular design allows extended functions, such as support for SSL encryption and dynamic web pages; 3. Configuration files (such as virtual host configurations) need to be carefully set to avoid security vulnerabilities, and optimize performance parameters, such as thread count and timeout time, in order to build high-performance and secure web applications.

This article describes how to effectively monitor the SSL performance of Nginx servers on Debian systems. We will use NginxExporter to export Nginx status data to Prometheus and then visually display it through Grafana. Step 1: Configuring Nginx First, we need to enable the stub_status module in the Nginx configuration file to obtain the status information of Nginx. Add the following snippet in your Nginx configuration file (usually located in /etc/nginx/nginx.conf or its include file): location/nginx_status{stub_status

How to solve the MySQL "Access denied for user" error: 1. Check the user's permission to connect to the database; 2. Reset the password; 3. Allow remote connections; 4. Refresh permissions; 5. Check the database server configuration (bind-address, skip-grant-tables); 6. Check the firewall rules; 7. Restart the MySQL service. Tip: Make changes after backing up the database.

This article describes how to customize Apache's log format on Debian systems. The following steps will guide you through the configuration process: Step 1: Access the Apache configuration file The main Apache configuration file of the Debian system is usually located in /etc/apache2/apache2.conf or /etc/apache2/httpd.conf. Open the configuration file with root permissions using the following command: sudonano/etc/apache2/apache2.conf or sudonano/etc/apache2/httpd.conf Step 2: Define custom log formats to find or
