|
<< Click to Display Table of Contents >> Navigation: Programming Mechworks PDM > DBWCommandShell > Library Reference > UserInterface > DBWFilterSelect4 |
Displays a selection box reading data from a database.
Same purpose as DBWFilterSelect3 but displays the dialog in a separate process.
Function DBWFilterSelect4(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
DBWFilterSelect3
DBWFilterSelect5
function DBWFilterSelect4(title,Dsn,User,Password,SelectStatement,FieldtoRead,FieldtoFilterOn,filtervalue,byref multiresult,position )
set obj = createObject("DBWJComp.FilterSelect")
if mid(Dsn,10,1)=":" OR mid(Dsn,9,2)="\\" then
cnnstr = Dsn
else
cnnstr = "DSN=" & Dsn & ";Uid=" & User & ";Pwd=" & Password & ";"
end if
'dbwmsgbox cnnstr
obj.connectionString = cnnstr
obj.query = SelectStatement
obj.filteringField = FieldtoFilterOn
obj.resultField = FieldtoRead
obj.title = title
obj.value = filtervalue
obj.ShowFormInDistinctProcess cint(position)
if obj.userHasCanceled then
DBWFilterSelect4=""
else
DBWFilterSelect4= obj.result
multiresult = obj.multipleresult
end if
set obj = nothing
end Function