|
<< Click to Display Table of Contents >> Navigation: Programming Mechworks PDM > DBWCommandShell > Library Reference > UserInterface > DBWFilterSelect3 |
Displays a selection box reading data from a database.
Same purpose as DBWFilterSelect2 but allowing to declare userid and password for the connection to DSN.
Function DBWFilterSelect3(Title, Dsn, Userid, Password, SelectStatement, FieldToRead, FieldToFilterOn, FilterValue, byref Multiresult, position)
Title |
title for the dialog box. |
|---|---|
Dsn |
ODBC data source name. |
Userid |
ODBC login. |
Password |
ODBC password for the above login. |
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 |
DBWFilterSelect1
DBWFilterSelect2
DBWFilterSelect4
DBWFilterSelect5
Sub main()
title="Select a material"
dsn="DBWMAT"
Userid="Luca"
Password="xxxyyy"
FieldtoRead="Name"
FieldToFilterOn="Family"
FilterValue=""
SelectStatement="SELECT * FROM TblMaterialTN ORDER BY Supplier"
position=0
dim multiresult
res=DBWFilterSelect3(title,Dsn,Userid,Password,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