1 Introduction
With the popularization of computer, database applications are more and more widely used, with image database applications has become an indispensable part of database applications, how to store the image information in the database, how to use development tools to achieve access to the graphics database has become a programmer must solve the problem, How to solve the above problems has become the focus of this paper.
2 ways to store image information in an Access database
There are many ways to store images in an Access database, for example, using OLE objects to store image information and storing image information in text, and using OLE objects to store image information is the advantage of embedding images in a database, and the benefit is that the program does not need special processing when the location of the database or original image is changed. However, the database that stores the image information with the OLE object will gradually slow down with the increase of the image and increase the storage space, while storing the image information with the text is the file name of the image in the text field, and the image used in the database is stored in the specified folder. The advantage of this approach is that the database takes up less storage space and runs faster.
3 method of accessing image information with vb.net
To introduce the implementation of the above methods, First of all, I set up a student information database named Database1.mdb and Database2.mdb in Access, which contains a table named information, one containing the text field named Name, and the OLE Object field named Picture, and the other containing A two-text field named name and picture. Then design a form in vb.net, as shown in Figure 1, and add a OpenFileDialog control named OpenFileDialog1.
Figure 1 Design interface for the form