InstallShield Custom Dialog (4)

zhaozj2021-02-17  55

/ * ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------ * /

/ * * /

/ * Function: checksqlserverdsninputvalid * /

/ * * /

/ * Descrip: Check theinput data is valid. * /

/ * Do Not NEED to Check the PWD if Empty * /

/ * Misc: * /

/ * * /

/ * ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------ * /

Function ChecksqlSerVerDsnInputValid (HWNDDLG, BALLLOWNOTSET)

String szdbusername;

String szsqldb;

String szsqladdr;

String szsqldsn;

Begin

IF (ballownotset) THEN

_WinsubenableControl (hwnddlg, sd_pbut_continue, 1);

Return 1;

Endif;

IF ((CtrlgetState (DSN_SQLSERVER_DLG, IDC_RADIO_DSN_USER = Button_unchecked) &&&

(CtrlgetState (DSN_SQLSERVER_DLG, IDC_RADIO_DSN_SYSTEM) = Button_unchecked)?

_WinsubenableControl (hwnddlg, sd_pbut_continue, 0);

Return 0;

Endif;

CtrlgetText (DSN_SQLSERVER_DLG, IDC_EDIT_SQLSERVER_USER_NAME, SZDBUSERNAME);

IF (Strlength) = 0) THEN

_WinsubenableControl (hwnddlg, sd_pbut_continue, 0);

Return 0;

Endif;

CtrlgetText (DSN_SQLSERVER_DLG, IDC_EDIT_SQLSERVER_DSN, SZSQLDSN);

IF (Strlength (Szsqldsn) = 0) THEN

_WinsubenableControl (hwnddlg, sd_pbut_continue, 0);

Return 0;

Else

IF (! sqlvaliddsn).

MessageBox ("Enter invalid data source name!", Information;

_WinsubfocusControl (hwnddlg, idc_edit_sqlserver_dsn);

Return 0;

Endif;

Endif;

CtrlgetText (DSN_SQLSERVER_DLG, IDC_EDIT_SQLSERVER_DB, SZSQLDB); IF (Strlength (Szsqldb) = 0) THEN

_WinsubenableControl (hwnddlg, sd_pbut_continue, 0);

Return 0;

Endif;

CtrlgetText (DSN_SQLSERVER_DLG, IDC_EDIT_DB_ADDR, SZSQLADDR);

IF (Strlength (Szsqladdr) = 0) THEN

_WinsubenableControl (hwnddlg, sd_pbut_continue, 0);

Return 0;

Endif;

_WinsubenableControl (hwnddlg, sd_pbut_continue, 1);

Return 1;

END;

#ENDIF / / __KDCIS_RUL_

转载请注明原文地址:https://www.9cbs.com/read-29735.html

New Post(0)