|
<< Click to Display Table of Contents >> Navigation: Programming Mechworks PDM > DBWCommandShell > Library Reference > UserInterface > DBWFilterSelect2 |
Displays a selection box reading data from a database.
Same purpose as DBWFilterSelect1 but allowing to set the position of the dialog.
Function DBWFilterSelect2(Title, Dsn, SelectStatement, FieldToRead, FieldToFilterOn, FilterValue, byref Multiresult, position)
Title |
title for the dialog box. |
|---|---|
Dsn |
ODBC data source name. |
SelectStatement |
SQL SELECT statement for the data |
FieldToRead |
name of the field to be read |
FieldToFilterOn |
name of the field on which apply the filter when inputting characters in the edit box |
FilterValue |
initial value for the filter that appears in the text box |
Position |
it the position of the dialog; possible values are: |
Multiresult |
It is an array of Field_to_Read values in the filtered records |
In case of a single element selection, the function itself assumes the result of the query.
DBWFilterSelect1
DBWFilterSelect3
DBWFilterSelect4
DBWFilterSelect5
Sub main()
title="Select a project"
dsn="DBWORKS"
FieldtoRead="ID"
FieldToFilterOn="T"
FilterValue="0"
SelectStatement="SELECT * FROM DOCUMENT"
position=0
res=DBWFilterSelect2(title,Dsn,SelectStatement,FieldtoRead,FieldToFilterOn,FilterValue,multiresult,position)
if res="" then
DBWMsgbox "user canceled"
else
DBWMsgbox ubound(multiresult)+1 & " result(s)"
for i=0 to ubound(multiresult)
DBWMsgbox multiresult(i)
next
end if
End sub