cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
vasanthakumarmk
Level 5

How to add one more dropdown list in SQLServerSelect dialog

Jump to solution
Hello All, I am very new to InstallShield, my requirement is like to add one more dropdown control along with 'SQLServerSelect' (This dialog already have one dropdown control which listed all available Database Servers). I need to add one more dropdown which need to list all available database names. I have used 'SQLRTGetDatabases' to get all available databases in the list. I need to show that list in the dropdown control on the 'SQLServerSelect' dialog. Can anyone please explain how to implement this?
0 Kudos
(2) Solutions
Jenifer
Flexera Alumni

Hi @vasanthakumarmk,

Below would be the sample snippet that could help you with:

//populate servers list listServers = SQLRTGetServers( TRUE );//Replace with your function call

if(svServer = "" ) then

ListGetFirstString( listServers, svServer );

endif;

CtrlSetList( DLG_SQLSELECT, COMBO_SERVERS, listServers );

CtrlSetText( DLG_SQLSELECT, COMBO_SERVERS, svServer );

ListDestroy( listServers );

hDlg = CmdGetHwndDlg(DLG_SQLSELECT);

SdGeneralInit(DLG_SQLSELECT, hDlg, 0, szSdProduct);

szTitle = GetDialogTitle(DLG_ASK_TEXT);

SdSetDlgTitle(DLG_SQLSELECT, hDlg, szTitle);

if(szMsg != "") then

CtrlSetText(DLG_SQLSELECT, SD_STA_MSG, szMsg);

endif;

 

The sample script file of SQLServerSelect dialog you could find on \\Script\isrt\Src\SQLServerSelectDlg.rul .You can play around with the same script file by replacing with your functions.

Hope it helps,

Thanks,

Jenifer

View solution in original post

0 Kudos

Hi @vasanthakumarmk ,

 

Glad that you could get things working.

CtrlSetText( DLG_SQLSELECT, COMBO_SERVERS, svServer );

doesn't help with setting default value before calling your function or whenever needed?

 

Thanks,

Jenifer

View solution in original post

0 Kudos
(7) Replies
Thanks for your reference link. Do you have any direct example code base?
0 Kudos
Jenifer
Flexera Alumni

Hi @vasanthakumarmk,

Below would be the sample snippet that could help you with:

//populate servers list listServers = SQLRTGetServers( TRUE );//Replace with your function call

if(svServer = "" ) then

ListGetFirstString( listServers, svServer );

endif;

CtrlSetList( DLG_SQLSELECT, COMBO_SERVERS, listServers );

CtrlSetText( DLG_SQLSELECT, COMBO_SERVERS, svServer );

ListDestroy( listServers );

hDlg = CmdGetHwndDlg(DLG_SQLSELECT);

SdGeneralInit(DLG_SQLSELECT, hDlg, 0, szSdProduct);

szTitle = GetDialogTitle(DLG_ASK_TEXT);

SdSetDlgTitle(DLG_SQLSELECT, hDlg, szTitle);

if(szMsg != "") then

CtrlSetText(DLG_SQLSELECT, SD_STA_MSG, szMsg);

endif;

 

The sample script file of SQLServerSelect dialog you could find on \\Script\isrt\Src\SQLServerSelectDlg.rul .You can play around with the same script file by replacing with your functions.

Hope it helps,

Thanks,

Jenifer

0 Kudos

Hi Jenifer,

Thank you so much for your help. Really appreciate your help. Its working now.

One more small doubt -> How do I have one default value in combobox ?

Regards,
Vasanth

0 Kudos

Hi @vasanthakumarmk ,

 

Glad that you could get things working.

CtrlSetText( DLG_SQLSELECT, COMBO_SERVERS, svServer );

doesn't help with setting default value before calling your function or whenever needed?

 

Thanks,

Jenifer

0 Kudos
Thank you... Its working.....
0 Kudos
Thank you Jenifer, Thanks a lot for your help.
One more small doubt -> How do I have one default value in combobox ?
0 Kudos