DBWFilterSelect1

<< Click to Display Table of Contents >>

Navigation:  Programming Mechworks PDM > DBWCommandShell > Library Reference > UserInterface >

DBWFilterSelect1

Description

Displays a selection box reading data from a database.

Syntax

Function DBWFilterSelect1(Title, Dsn, SelectStatement, FieldToRead, FieldToFilterOn, FilterValuebyref Multiresult)

Parameters

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

Return values

Multiresult

It is an array of Field_to_Read values in the filtered records

See also

DBWFilterSelect2
DBWFilterSelect3
DBWFilterSelect4
DBWFilterSelect5

Example

Sub main()
 title="Select a material"
 dsn="DBWMAT"
 FieldtoRead="Name"
 FieldToFilterOn="Family"
 FilterValue=""
 SelectStatement="SELECT * FROM TblMaterialTN ORDER BY Supplier"
 dim multiresult
 res=DBWFilterSelect1(title,Dsn,SelectStatement,FieldtoRead,FieldToFilterOn, FilterValue, multiresult)
 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