Using VB to access image data in SQL Server

Source: Internet
Author: User

This paper introduces the storage mechanism and access method of MIS SQL Server for image data. Aiming at the VB development tool, this paper introduces a method of accessing the image data in MIS SQL server by using the GetChunk method of ADO Field object and the AppendChunk method.

In a perfect hospital information mis, the access of image data is essential, such as the preservation of X-rays and CT pictures. On the one hand, these image data provide an important basis for the accurate diagnosis of the disease, on the other hand, it provides the basic condition for quick access to the patient's data. The access of image data is widely used in other application systems such as GIS.

1. Storage mechanism of image data in SQL Server

In MIS SQL server, image data that is less than 8,000 bytes can be represented by a binary type (binary, varbinary). But some medical image images that are usually saved are larger than 8,000 bytes. SQL Server provides a mechanism for storing binary objects (BLOBs) of up to 2GB per row, which can include image, text, and ntext three types of data. The image data type stores binary data with a maximum length of 231-1 (2,147,483,647) bytes.

BLOB data is stored in an MIS SQL Server system in a different way than a normal data type, and for a typical type of data system, a data value is stored directly on a user-defined field, and for BLOB type data, the system opens up new storage pages to store the data. A BLOB type data field in a table holds only a 16-byte pointer to the page that holds the BLOB data for that record.

2. Access to image data in SQL Server

In MIS SQL server, when the data is less than 8,000 bytes, manipulation of the field can be done with normal SQL manipulation statements (SELECT, INSERT, UPDATE, DELETE), and when the data is greater than 8,000 bytes, SQL provides the WRITETEXT , ReadText, and UPDATETEXT these three functions to read and modify data. These three functions are used in the following ways:

(1) writetext {table.column Text_ptr}[with LOG] {data}

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.