The role of mybookmark in the student information management system

Source: Internet
Author: User

In the student information management system, the bookmark function (mybookmark) is often used for information modification ). It plays an important role in deleting records. Therefore, Bookmarks have the best understanding of your heart.
As the name implies, bookmarks are marked to allow us to better control data tables, through bookmarks, we can jump to the record we want to see at Will (provided that you mark the record for your purpose ), in addition, Bookmarks can also be used to determine whether there are null records under the current cursor (for empty records, mybookmark will return 0)
The following example shows how to delete a record in the student information management system to describe the usefulness of bookmarks:
 
[Html]
<Span style = "font-size: 18px;"> Private sub deletecommand_click ()
 
Mybook = mrc. bookmark' tag the current record
 
Str = msgbox "are you sure you want to delete the current record", vbokcancel, "prompt"
 
If str = vbokthen
 
Mrc. movenext
 
If mrc. eof then ', the record to be deleted must be the last one (not sure If it is the first one)
 
Mrc. movefirst
 
Mybookmark = mrc. bookmark' label the first entry
 
Mrc. movelast
 
Mrc. delete
 
Mrc. bookmark = mybookmark 'display the record back to the previously defined bookmarks
 
If mybookmark = 0 then', you give the tag to the first record, but the first record is empty (the record to be deleted must be a unique record)
</Span> <span style = "font-size: 18px;">
Msgbox "you will delete the last record", "prompt"
 
Exit sub
 
End if
 
Call viewData
 
Else' the record to be deleted is not the last record
 
Mybookmark = mrc. bookmark' label mrc. movenext
 
Mrc. moveprevious 'back to the record to be deleted
 
Mrc. delete
 

Mrc. bookmark = mybookmark 'display the record back to the previously defined bookmarks
 
Call viewData
 
End if
 
Else' cancel deleting record
 
Mrcbookmark = mybookmark' show the position of the newly defined bookmark in the record
 
Call viewData
 
End if
 
End sub
</Span>
So why didn't we define bookmarks when using cursors to view records? In fact, this is really not the case. When we view records, the cursor points to the bookmarks without defining bookmarks.
This is what I know about bookmarks. If there is something wrong, I hope to help me correct it.

Related Article

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.