Home > database >  How to make a picture control, according to the records in the data window to display the images?
How to make a picture control, according to the records in the data window to display the images?

Time:10-03

How to make a picture control, according to the records in the data window to display the image, when the data window record changes, image control according to the records in the data window to take pictures in the database, and display.

CodePudding user response:

DW itemchanged events in writing code

CodePudding user response:

Control picture with code control can
If storage path: picture controls. PictureName='taken out to the database path'
If the deposit is of type blob images data: controls. SetPicture taken out a blob data (database)

CodePudding user response:

To 1/f, no.
2nd floor of the like and I don't think of.
This is what I want in the data window are some of the information, the staff of the image control according to the data window changes of data in the data window records information and photos.

CodePudding user response:

Put the code after the DW saved successfully

CodePudding user response:

Stored in DW what events

CodePudding user response:

My code is written so
String ls_hao, ls_name
Blob gb_photo
Ls_hao=dw_1. GetItemString (1, "employee number"),//take the number of employees in the current data window
Ls_name=dw_1. GetItemString (1, "employee name")//get the current data window the employee name
Selectblob photo into: gb_photo from basic where employees=: ls_hao and employee name=: ls_name using the SQLCA.//from the database, which is corresponding to the current data window photo information
P_2. Setpicture (gb_photo)
But when the point of "next page" change data records in the window, the image controls the photos will not change.
Why is this?

CodePudding user response:

In dw rowfocuschanged event:
Selectrow (0, false)
Selectrow (currentrow, true)
If isnull (currentrow) or currentrow=0 then currentrow=1
String ls_hao, ls_name
Blob gb_photo
Ls_hao=dw_1. GetItemString (currentrow, "employee number")//take the number of employees in the current data window
Ls_name=dw_1. GetItemString (currentrow, "employee name")//get the current data window in the employee name
Selectblob photo into: gb_photo from basic where employees=: ls_hao and employee name=: ls_name using the SQLCA.//from the database, which is corresponding to the current data window photo information
P_2. Setpicture (gb_photo)

CodePudding user response:

Upstairs method can be used, but a new problem. When I ordered "next page" when the last record to the database, there will be a crash, is this why?
  • Related