Using PB to develop multimedia database management system

Source: Internet
Author: User
Tags ole

Image, sound and digital video are the basic elements of multimedia, so the multimedia database is being widely used. For example: Guilin opened the interactive cable TV real-time song system, that is, people can use the telephone button song, and at the same time on TV to see their own control menu, selected songs immediately automatically play MTV TV, no one needs help, this is the specific application of network multimedia database. When you develop an application with PowerBuilder, you can integrate multimedia data into your application so that your application has many features such as multimedia recording, query playback, and so on. Obviously, multimedia will further improve the application hierarchy and give users a sense of immersive.

How do I use PowerBuilder to create and present a multimedia database? It can be divided into two parts:

1. How to store images, sounds and animations in a database

2. Query system production.

Here's an example of PowerBuilder6.5 and SQL anywhere. Let's quickly make a simple query system. Make a marriage referral system, and find out who meets the criteria, show that the person's personnel file card has a personal photo, request to double-click Personal photos, can call ACDSee show the photo (customers can zoom in, zoom in on the photo), or double-click the personal file to show a section of the personal record of personal life, Personal favorite music and so on.

How to store images, sounds and animations in a database

You would first have a table with a Blob data type, and then take advantage of the BB Data window's OLE database Blob (OLE DB binary object) to easily save multimedia data such as pictures to the database or display on the screen.

The steps are as follows:

1. Create a table AAA with two fields, record numbers and photos, one field named ID, another field named pic, and type char and long binary,id as the primary key. The specific steps are: Enter the database brush to establish this table, the ID field takes the type char, not empty, that is, NULL is the No,pic field type is long binary, nullable, that is, NULL is yes (important). Change the title of the English heading to Chinese, the ID field header "id" changed to "record number", the contents of the label changed to "record number:", the same as the pic field to "photo" and "Photo:" Press the close icon, save the file name of AAA, press table Properties icon, press Primary key, and click the ID as the primary key, and close the database brush by closing icon.

Note: Do not enter data in this step, but in the following Data window, press the preview icon to enter the data.

The data type of the PIC field is called a blob type, and its data type differs somewhat from the DBMS: Long binary in SQL Anywhere and image in SQL Server.

2. Create a new application. The concrete operation steps are: Press application icon, press New icon, filename fill test, press Save, Application Fill test, press OK, appear a "Would You like ..." dialog box, ask if you want application template, press "Yes", To simplify the process of making a template.

3. Create a data window and prepare to enter data. To do this: press the DataWindow icon, select New in the Select DataWindow dialog box, and select SQL Slect and freeform in the new DataWindow dialog box, which is the SQL-selected data source, Free-form style. Press OK to select the AAA form in the Select Talbe dialog box and press Open. Click the ID column so that the ID appears to the right of the select list, press the Where button at the bottom of the window, press Colume, and select "AAA" in the Cloume Drop-down bar. ID, fill in the column of Valua: temp, note that there is a colon in front of the Window desion menu, select Retriveal Arguments, fill in the Name column temp, note that there is no colon in front of temp, Type a column (note), press OK.

Rule: SQL statements can be embedded in the PowerScript language, except that each SQL statement must end with a semicolon, and if you want to refer to the POWERSCRIPT variable in the SQL statement, You must give these variables a prefix--a colon: and powerscript the variables of the statement without a colon, pay attention to the distinction.

4. Enter data in a preview of the data window. The specific steps are: Press desion menu, select data source so that data source does not tick before, choose OLE Database blob items from the Objects menu, and then click the left mouse button in the design window where the Database blob appears Object dialog box. Gradually fill out the dialogue window:

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.