|
<< Click to Display Table of Contents >> Navigation: Programming Mechworks PDM > DBWCommandShell > Library Reference > UserInterface > DBWListFromQuery1 |
Shows a dialog box that allows to choose between entries retrieved from a query to a datasource that requires authentication.
Function DBWListFromQuery1(DataSource, SQLQuery, ColumnToChooseFrom, Title, User, Password, ByRef Resp)
DataSource |
name of a valid datasource to query or |
|---|---|
SQLQuery |
string containing the query to submit to the datasource. |
ColumnToChooseFrom |
integer (starting from 1) that specifies the column to choose values from. SELECT a,b,c this parameter specify that values will be chosen from a, b or c column. |
Title |
dialog box title |
User |
user name |
Password |
user password |

TRUE |
if the user has closed the dialog by pressing the OK button |
|---|---|
FALSE |
if the user has closed the dialog by pressing the CANCEL button |
Resp |
Contains the item selected. If the function has a FALSE value resp contains a null string. |
When connecting through file DSN, it's mandatory to use the datasource declared as @USEDEFAULTDATASOURCE.
Function DBWListFromQuery
Function DBWList
Function DBWListFiles
Function DBWListFromFile
datasource = "DBWORKS"
sql_query = "SELECT T,ID FROM DOCUMENT"
column = 2
title = "Item selection"
user = "luca"
pass = "dbworks"
ok = DBWListFromQuery1(datasource, sql_query, column, title, user, pass, resp)
if ok then
DBWmsgbox "The value selected is " & vbCRLF & resp
else
DBWmsgbox "The user has canceled"
end if
...
ok = DBWListFromQuery1("@USEDEFAULTDATASOURCE", sql_query, column, title, user, pass, resp)
...