From: <jcm...@us...> - 2006-02-05 13:12:37
|
Revision: 579 Author: jcmoraisjr Date: 2006-02-05 05:12:11 -0800 (Sun, 05 Feb 2006) ViewCVS: http://svn.sourceforge.net/instantobjects?rev=579&view=rev Log Message: ----------- Inserted fields to enter user name, password, sql role and character set name to IBX's ConnectionDef form. InternalCreateDatabase uses current character set to create physical database. (FR # 1424512) Modified Paths: -------------- trunk/Source/Brokers/IBX/InstantIBX.pas trunk/Source/Brokers/IBX/InstantIBXConnectionDefEdit.dfm trunk/Source/Brokers/IBX/InstantIBXConnectionDefEdit.pas Modified: trunk/Source/Brokers/IBX/InstantIBX.pas =================================================================== --- trunk/Source/Brokers/IBX/InstantIBX.pas 2006-02-03 21:49:42 UTC (rev 578) +++ trunk/Source/Brokers/IBX/InstantIBX.pas 2006-02-05 13:12:11 UTC (rev 579) @@ -288,14 +288,21 @@ end; procedure TInstantIBXConnector.InternalCreateDatabase; +const + CreateDatabaseParam = + 'USER ''%s'' PASSWORD ''%s'' PAGE_SIZE 4096 DEFAULT CHARACTER SET %s'; var OldConnectionParams: string; + CharacterSetName: string; begin inherited; OldConnectionParams := Connection.Params.Text; + CharacterSetName := Connection.Params.Values['lc_ctype']; + if CharacterSetName = '' then + CharacterSetName := 'none'; with Connection.Params do - Text := Format('USER ''%s'' PASSWORD ''%s'' PAGE_SIZE 4096', - [Values['user_name'], Values['password']]); + Text := Format(CreateDatabaseParam, + [Values['user_name'], Values['password'], CharacterSetName]); try try Connection.CreateDatabase; Modified: trunk/Source/Brokers/IBX/InstantIBXConnectionDefEdit.dfm =================================================================== --- trunk/Source/Brokers/IBX/InstantIBXConnectionDefEdit.dfm 2006-02-03 21:49:42 UTC (rev 578) +++ trunk/Source/Brokers/IBX/InstantIBXConnectionDefEdit.dfm 2006-02-05 13:12:11 UTC (rev 579) @@ -3,7 +3,7 @@ Top = 238 BorderStyle = bsDialog Caption = 'IBX Connection' - ClientHeight = 339 + ClientHeight = 334 ClientWidth = 362 Color = clBtnFace Font.Charset = DEFAULT_CHARSET @@ -18,7 +18,7 @@ TextHeight = 13 object BottomBevel: TBevel Left = 0 - Top = 302 + Top = 297 Width = 362 Height = 2 Align = alBottom @@ -28,60 +28,92 @@ Left = 0 Top = 0 Width = 362 - Height = 302 + Height = 297 Align = alClient BevelOuter = bvNone TabOrder = 0 object ConnectionStringLabel: TLabel Left = 16 - Top = 12 + Top = 16 Width = 84 Height = 13 Caption = '&Connection String' FocusControl = ConnectionStringEdit end - object StreamFormatLabel: TLabel + object UserNameLabel: TLabel Left = 16 - Top = 248 - Width = 53 + Top = 80 + Width = 51 Height = 13 - Caption = 'Blob &format' - FocusControl = StreamFormatComboBox + Caption = 'User &name' + FocusControl = UserNameEdit end + object PasswordLabel: TLabel + Left = 16 + Top = 120 + Width = 46 + Height = 13 + Caption = 'Pass&word' + FocusControl = PasswordEdit + end + object SQLRoleLabel: TLabel + Left = 16 + Top = 160 + Width = 46 + Height = 13 + Caption = 'S&QL Role' + FocusControl = SQLRoleEdit + end + object CharacterSetLabel: TLabel + Left = 16 + Top = 200 + Width = 63 + Height = 13 + Caption = 'C&haracter set' + FocusControl = CharacterSetComboBox + end object ParamsLabel: TLabel - Left = 16 - Top = 76 + Left = 136 + Top = 80 Width = 95 Height = 13 Caption = 'Connection &Settings' FocusControl = ParamsEditor end + object StreamFormatLabel: TLabel + Left = 16 + Top = 240 + Width = 53 + Height = 13 + Caption = 'Blob &format' + FocusControl = StreamFormatComboBox + end object IdDataTypeLabel: TLabel Left = 136 - Top = 248 + Top = 240 Width = 62 Height = 13 - Caption = 'Id Data Type' + Caption = 'Id &Data Type' FocusControl = IdDataTypeComboBox end object IdSizeLabel: TLabel Left = 256 - Top = 248 + Top = 240 Width = 32 Height = 13 - Caption = 'Id Size' + Caption = 'Id Si&ze' FocusControl = IdDataTypeComboBox end object ConnectionStringEdit: TEdit Left = 16 - Top = 28 + Top = 32 Width = 301 Height = 21 TabOrder = 0 end object ConnectionStringButton: TButton Left = 321 - Top = 28 + Top = 32 Width = 21 Height = 21 Caption = '...' @@ -90,17 +122,17 @@ end object StreamFormatComboBox: TComboBox Left = 16 - Top = 264 + Top = 256 Width = 113 Height = 21 Style = csDropDownList ItemHeight = 13 Sorted = True - TabOrder = 5 + TabOrder = 9 end object UseDelimitedIdentsCheckBox: TCheckBox Left = 16 - Top = 54 + Top = 56 Width = 150 Height = 17 Caption = '&Use delimited identifiers' @@ -108,39 +140,98 @@ end object LoginPromptCheckBox: TCheckBox Left = 196 - Top = 54 + Top = 56 Width = 150 Height = 17 Caption = '&Login Prompt' TabOrder = 3 end object ParamsEditor: TMemo - Left = 17 + Left = 136 Top = 96 - Width = 328 - Height = 149 - TabOrder = 4 + Width = 209 + Height = 141 + TabOrder = 8 end object IdDataTypeComboBox: TComboBox Left = 136 - Top = 264 + Top = 256 Width = 113 Height = 21 Style = csDropDownList ItemHeight = 13 - TabOrder = 6 + TabOrder = 10 end object IdSizeEdit: TEdit Left = 256 - Top = 264 + Top = 256 Width = 89 Height = 21 + TabOrder = 11 + end + object UserNameEdit: TEdit + Left = 16 + Top = 96 + Width = 113 + Height = 21 + TabOrder = 4 + OnChange = UserNameEditChange + end + object PasswordEdit: TEdit + Left = 16 + Top = 136 + Width = 113 + Height = 21 + TabOrder = 5 + OnChange = PasswordEditChange + end + object SQLRoleEdit: TEdit + Left = 16 + Top = 176 + Width = 113 + Height = 21 + TabOrder = 6 + OnChange = SQLRoleEditChange + end + object CharacterSetComboBox: TComboBox + Left = 16 + Top = 216 + Width = 113 + Height = 21 + ItemHeight = 13 TabOrder = 7 + OnChange = CharacterSetComboBoxChange + Items.Strings = ( + 'None' + 'ASCII' + 'BIG_5' + 'CYRL' + 'DOS437' + 'DOS850' + 'DOS852' + 'DOS857' + 'DOS860' + 'DOS861' + 'DOS863' + 'DOS865' + 'EUCJ_0208' + 'GB_2312' + 'ISO8859_1' + 'KSC_5601' + 'NEXT' + 'OCTETS' + 'SJIS_0208' + 'UNICODE_FSS' + 'WIN1250' + 'WIN1251' + 'WIN1252' + 'WIN1253' + 'WIN1254') end end object BottomPanel: TPanel Left = 0 - Top = 304 + Top = 299 Width = 362 Height = 35 Align = alBottom Modified: trunk/Source/Brokers/IBX/InstantIBXConnectionDefEdit.pas =================================================================== --- trunk/Source/Brokers/IBX/InstantIBXConnectionDefEdit.pas 2006-02-03 21:49:42 UTC (rev 578) +++ trunk/Source/Brokers/IBX/InstantIBXConnectionDefEdit.pas 2006-02-05 13:12:11 UTC (rev 579) @@ -62,8 +62,20 @@ IdDataTypeLabel: TLabel; IdSizeEdit: TEdit; IdSizeLabel: TLabel; + UserNameLabel: TLabel; + UserNameEdit: TEdit; + PasswordLabel: TLabel; + PasswordEdit: TEdit; + SQLRoleLabel: TLabel; + SQLRoleEdit: TEdit; + CharacterSetLabel: TLabel; + CharacterSetComboBox: TComboBox; procedure ConnectionStringButtonClick(Sender: TObject); procedure FormCreate(Sender: TObject); + procedure UserNameEditChange(Sender: TObject); + procedure PasswordEditChange(Sender: TObject); + procedure SQLRoleEditChange(Sender: TObject); + procedure CharacterSetComboBoxChange(Sender: TObject); private function GetIsValid: Boolean; public @@ -122,6 +134,10 @@ ParamsEditor.Lines.Text := ConnectionDef.Params; IdDataTypeComboBox.ItemIndex := Ord(IdDataType); IdSizeEdit.Text := IntToStr(IdSize); + UserNameEdit.Text := ParamsEditor.Lines.Values['user_name']; + PasswordEdit.Text := ParamsEditor.Lines.Values['password']; + SQLRoleEdit.Text := ParamsEditor.Lines.Values['sql_role_name']; + CharacterSetComboBox.Text := ParamsEditor.Lines.Values['lc_ctype']; end; end; @@ -142,5 +158,28 @@ end; end; +procedure TInstantIBXConnectionDefEditForm.UserNameEditChange( + Sender: TObject); +begin + ParamsEditor.Lines.Values['user_name'] := UserNameEdit.Text; +end; + +procedure TInstantIBXConnectionDefEditForm.PasswordEditChange( + Sender: TObject); +begin + ParamsEditor.Lines.Values['password'] := PasswordEdit.Text; +end; + +procedure TInstantIBXConnectionDefEditForm.SQLRoleEditChange( + Sender: TObject); +begin + ParamsEditor.Lines.Values['sql_role_name'] := SQLRoleEdit.Text; +end; + +procedure TInstantIBXConnectionDefEditForm.CharacterSetComboBoxChange( + Sender: TObject); +begin + ParamsEditor.Lines.Values['lc_ctype'] := CharacterSetComboBox.Text; +end; + end. - |