<< Chapter < Page Chapter >> Page >

JET là một bộ máy cơ sở dữ liệu tuyệt vời cho các ứng dụng văn phòng chạy trên máy đơn, nhưng hiệu suất của nó giảm đáng kể khi số lượng người dùng tăng lên và cơ sở dữ liệu được mở rộng. Vì điều này JET không phải là một giải pháp tối ưu cho các ứng dụng cơ sở dữ liệu nhiều người dùng. Cho đến nay người ta chưa có một thống kê chính xác được kích thước dữ liệu tối đa hay số lượng người dùng tối đa của JET nhưng nhìn chung JET bị giới hạn nhiều hơn so với các giải pháp khác trong môi trường đa người dùng. Tuy vậy, JET là điểm khởi đầu tốt nhất cho người lập trình VB bởi vì sự đơn giản của nó.

Khi kích thước dữ liệu tăng lên, người lập trình bao giờ cũng muốn xây dựng một ứng dụng Khách/Chủ (Client/Server) có khả năng bảo mật cao và linh hoạt. Vì lẽ đó, Microsoft hỗ trợ trong VB để truy cập các cơ sở dữ liệu quan hệ được thông dịch bởi chuẩn Open Database Connectivity (ODBC). ODBC là một kỹ thuật cho phép truy cập các cơ sở dữ liệu quan hệ cao cấp như SQL SERVER hay ORACLE. Tuy nhiên, ODBC cũng có thể được sử dụng để truy cập các cơ sở dữ liệu nhỏ tổ chức bằng Microsoft Access hay Foxpro, thậm chí các cơ sở dữ liệu máy chủ như IBM DB2. Visual Basic sử dụng giao diện đối tượng Remote Data Objects (RDO) để truy cập ODBC.

DAO và RDO là những kỹ thuật hỗ trợ việc truy xuất đến các cơ sở dữ liệu quan hệ. Tuy nhiên, Microsoft lại cung cấp một công cụ hữu ích hơn để truy cập dữ liệu goi là OLEDB. OLEDB là kỹ thuật cho phép dữ liệu được truy xuất từ cả 2 nguồn cơ sở dữ liệu: quan hệ và không quan hệ. Điều đó có nghĩa là gồm các cơ sở dữ liệu của Microsoft Access, Oracle, SQL SERVER và cả các nguồn dữ liệu không quan hệ như Excel, Microsoft Index Server, Microsoft Exchange, Active Directory… Visual Basic sử dụng giao diện đối tượng ActiveX Data Objects (ADO) để truy cập OLEDB.

Visual Basic cung cấp cho ta nhiều công cụ để truy cập dữ liệu như DAO, RDO, ADO. Câu hỏi thường đặt ra là: Kỹ thuật nào được sử dụng lúc nào ở đâu? Nhiều người cho rằng DAO&RDO đã lỗi thời và người ta hiếm sử dụng chúng. Thật ra DAO&RDO là các điển hình cho một vài khả năng tiêu biểu của ADO. Hiện nay, vẫn còn khá nhiều ứng dụng sử dụng DAO&RDO và thật sự chúng bị giới hạn trong chừng mực nào đó. OLEDB thực sự cung cấp một khả năng rộng lớn để truy cập các cơ sở dữ liệu từ nhiều nguồn khác nhau. Tuy vậy, trong một số trường hợp một giải pháp dùng RDO lại hữu dụng hơn ADO.

Dùng visual basic để tạo một cơ sở dữ liệu

Thông thường chúng ta sẽ sử dụng các hệ quản trị cơ sở dữ liệu để tạo nên một cơ sở dữ liệu, nhưng trong phần này ta sẽ xét qua tính năng tạo cơ sở dữ liệu bằng Visual Basic 6.0. Ta có thể áp dụng phương pháp này cho những cơ sở dữ liệu nhỏ và tương thích với Microsoft Access.

Sử dụng cửa sổ cơ sở dữ liệu

  • Từ Menu của VB6, chọn mục Add-Ins, Visual Data Manager. Cửa sổ Visual Data Manager sẽ xuất hiện.
  • Chọn mục File ->New ->MicroSoft Access ->Version 7.0 MDB.
  • Chọn thư mục ta muốn lưu cơ sở dữ liệu và tên của cơ sở dữ liệu.

Hình VIII.1 Cửa sổ Visual Data Manager

Tạo bảng

  • Để tạo mới một bảng, ta chọn Properties trong cửa sổ Databases, nhấp chuột phải, chọn New Table, đặt tên cho Table tại ô Table Name, ấn Add Field để tạo mới các trường cho bảng.

Questions & Answers

how does Neisseria cause meningitis
Nyibol Reply
what is microbiologist
Muhammad Reply
what is errata
Muhammad
is the branch of biology that deals with the study of microorganisms.
Ntefuni Reply
What is microbiology
Mercy Reply
studies of microbes
Louisiaste
when we takee the specimen which lumbar,spin,
Ziyad Reply
How bacteria create energy to survive?
Muhamad Reply
Bacteria doesn't produce energy they are dependent upon their substrate in case of lack of nutrients they are able to make spores which helps them to sustain in harsh environments
_Adnan
But not all bacteria make spores, l mean Eukaryotic cells have Mitochondria which acts as powerhouse for them, since bacteria don't have it, what is the substitution for it?
Muhamad
they make spores
Louisiaste
what is sporadic nd endemic, epidemic
Aminu Reply
the significance of food webs for disease transmission
Abreham
food webs brings about an infection as an individual depends on number of diseased foods or carriers dully.
Mark
explain assimilatory nitrate reduction
Esinniobiwa Reply
Assimilatory nitrate reduction is a process that occurs in some microorganisms, such as bacteria and archaea, in which nitrate (NO3-) is reduced to nitrite (NO2-), and then further reduced to ammonia (NH3).
Elkana
This process is called assimilatory nitrate reduction because the nitrogen that is produced is incorporated in the cells of microorganisms where it can be used in the synthesis of amino acids and other nitrogen products
Elkana
Examples of thermophilic organisms
Shu Reply
Give Examples of thermophilic organisms
Shu
advantages of normal Flora to the host
Micheal Reply
Prevent foreign microbes to the host
Abubakar
they provide healthier benefits to their hosts
ayesha
They are friends to host only when Host immune system is strong and become enemies when the host immune system is weakened . very bad relationship!
Mark
what is cell
faisal Reply
cell is the smallest unit of life
Fauziya
cell is the smallest unit of life
Akanni
ok
Innocent
cell is the structural and functional unit of life
Hasan
is the fundamental units of Life
Musa
what are emergency diseases
Micheal Reply
There are nothing like emergency disease but there are some common medical emergency which can occur simultaneously like Bleeding,heart attack,Breathing difficulties,severe pain heart stock.Hope you will get my point .Have a nice day ❣️
_Adnan
define infection ,prevention and control
Innocent
I think infection prevention and control is the avoidance of all things we do that gives out break of infections and promotion of health practices that promote life
Lubega
Heyy Lubega hussein where are u from?
_Adnan
en français
Adama
which site have a normal flora
ESTHER Reply
Many sites of the body have it Skin Nasal cavity Oral cavity Gastro intestinal tract
Safaa
skin
Asiina
skin,Oral,Nasal,GIt
Sadik
How can Commensal can Bacteria change into pathogen?
Sadik
How can Commensal Bacteria change into pathogen?
Sadik
all
Tesfaye
by fussion
Asiina
what are the advantages of normal Flora to the host
Micheal
what are the ways of control and prevention of nosocomial infection in the hospital
Micheal
what is inflammation
Shelly Reply
part of a tissue or an organ being wounded or bruised.
Wilfred
what term is used to name and classify microorganisms?
Micheal Reply
Binomial nomenclature
adeolu
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Giáo trình visual basic. OpenStax CNX. Jul 29, 2009 Download for free at http://cnx.org/content/col10777/1.1
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Giáo trình visual basic' conversation and receive update notifications?

Ask