<< Chapter < Page Chapter >> Page >

- RecordEffected: Tùy chọn, là một số nguyên dài (Long) xác định trình cung cấp trả về bao nhiêu mẩu tin thỏa điều kiện.

- Options: Tùy chọn, là một số nguyên dài (Long) xác định trình cung cấp sẽ đánh giá các đối số của CommandText như thế nào.

Thuộc tính Mode: Xác định trình cung cấp có thể hạn chế truy cập đến cơ sở dữ liệu khi có một recordset đang mở. Các giá trị có thể là:

Hằng số Giá trị Ý nghĩa
adModeUnknown 0 Mặc định, chỉ định quyền hạn chưa thiết lập hay không thể xác định
adModeRead 1 Mở Recordset với quyền chỉ đọc
adModeWrite 2 Mở Recordset với quyền chỉ ghi
adModeReadWrite 3 Mở Recordset với quyền đọc/ghi
adModeShareDenyRead 4 Ngăn người khác mở kết nối với quyền chỉ đọc
adModeShareDenyWrite 8 Ngăn người khác mở kết nối với quyền chỉ ghi
adModeShareExclusive 12 Ngăn người khác mở kết nối
adModeShareDenyNone 16 Ngăn người khác mở kết nối với bất cứ quyền nào

Đối tượng recordset

Để có thể khởi tạo một đối tượng Recordset ta có thể thực hiện một trong hai cách:

  • Phương thức Execute của đối tượng Connection. Tuy nhiên cách này ta chỉ tạo được các Recordset chỉ đọc và chỉ có thể di chuyển tới.
  • Xác lập các thông số thích hợp cho đối tượng Recordset rồi thực thi phuơng thức Open của đối tượng Recordset. Điều này được thực hiện nhờ các bước:
    • Sau khi khởi tạo đối tượng Connection, chỉ định Recordset là của đối tượng Connection trên.
    • Thiết lập các thuộc tính thích hợp của Recordset (Source, LockType…).
    • Thực thi câu truy vấn nối kết nhờ phương thức Open.

Thuộc tính cursortype (loại con trỏ)

Xác định loại con trỏ được trả về từ cơ sở dữ liệu. Các giá trị có thể nhận:

Hằng Giá trị Mô tả
adOpenForwardOnly 0 Chỉ có thể di chuyển phía trước
adOpenKeyset 1 Không thể thấy các mẩu tin do người dùng khác thêm vào nhưng khi họ xóa hay sửa đổi mẩu tin sẽ làm ảnh hưởng đến các mẩu tin ta đang làm việc.
adOpenDynamic 2 Có thể thấy toàn bộ sự thay đổi do người dùng khác tác động.
adOpenStatic 3 Bản sao tĩnh của tập mẩu tin. Mọi sự thay đổi của người dùng khác ta không thấy được

Thuộc tính locktype (khóa mẩu tin)

Xác định cách thức khóa mẩu tin trong Recordset. Dùng tính năng này khi muốn kiểm soát cách thức cập nhật mẩu tin với nhiều người dùng trong cơ sở dữ liệu.

Hằng Giá trị Mô tả
adLockReadOnly 1 Mặc định - Chỉ đọc.
adLockPessimistic 2 Khóa trang bi quan. Mẩu tin trong RecordSet bị khóa khi bắt đầu sửa đổi&tiếp tục khóa cho đến khi thi hành phương thức Update hay di chuyển sang mẩu tin khác.
adLockOptimistic 3 Khóa trang lạc quan. Mẩu tin chỉ bị khóa ngay lúc thi hành phương thức Update hay di chuyển sang mẩu tin khác.
adLockBatchOptimistic 4 Khóa trang lạc quan hàng loạt. Hỗ trợ cập nhật nhiều mẩu tin cùng một lúc.

Thuộc tính source

Đây là một chuỗi xác định câu truy vấn để lấy dữ liệu, có thể là tên của bảng hay tên của thủ tục lưu trữ sẵn.

Thuộc tính activeconnection

Đây là một thuộc tính đối tượng xác định Recordset là của nối kết nào trong chương trình.

Ví dụ sử dụng đối tượng recordset trong chương trình

Đối tượng Recordset có thể được sử dụng là đối tượng nguồn dữ liệu (DataSource) của điều khiển lưới: Microsoft DataGrid Control 6.0 (OLEDB). Nhờ điều khiển lưới này ta có thể hiển thị dữ liệu từ một Recordset theo dạng hàng và cột.

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