Subversion Repositories indexer_suite

Rev

Rev 7 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7 Rev 8
Line 1... Line 1...
1
unit AdoConnHelper;
1
unit AdoConnHelper;
2
 
2
 
3
(*
3
(*
4
 * Class helper for TAdoConnection
4
 * Class helper for TAdoConnection
5
 * by Daniel Marschall, ViaThinkSoft <www.viathinksoft.com>
5
 * by Daniel Marschall, ViaThinkSoft <www.viathinksoft.com>
6
 * Revision: 28 Aug 2018
6
 * Revision: 14 June 2021
7
 *)
7
 *)
8
 
8
 
9
interface
9
interface
10
 
10
 
11
uses
11
uses
Line 89... Line 89...
89
  result.EnableBCD := false;
89
  result.EnableBCD := false;
90
  result.ParamCheck := false;
90
  result.ParamCheck := false;
91
  result.CommandType := cmdText;
91
  result.CommandType := cmdText;
92
  result.CommandText := SQL;
92
  result.CommandText := SQL;
93
  result.DisableControls;
93
  result.DisableControls;
-
 
94
  if ATimeout <> -1 then
94
  if ATimeout <> -1 then result.CommandTimeout := ATimeout;
95
    result.CommandTimeout := ATimeout
-
 
96
  else
-
 
97
    result.CommandTimeout := self.CommandTimeout;
95
  result.Active := true;
98
  result.Active := true;
96
end;
99
end;
97
 
100
 
98
function TAdoConnectionHelper.ColumnExists(aTableName, aColumnName: string): boolean;
101
function TAdoConnectionHelper.ColumnExists(aTableName, aColumnName: string): boolean;
99
begin
102
begin
Line 174... Line 177...
174
  try
177
  try
175
    cmd.Connection := Self;
178
    cmd.Connection := Self;
176
    cmd.ParamCheck := false;
179
    cmd.ParamCheck := false;
177
    cmd.CommandType := cmdText;
180
    cmd.CommandType := cmdText;
178
    cmd.CommandText := SQL;
181
    cmd.CommandText := SQL;
-
 
182
    if ATimeOut <> -1 then
179
    if ATimeOut <> -1 then cmd.CommandTimeout := ATimeout;
183
      cmd.CommandTimeout := ATimeout
-
 
184
    else
-
 
185
      cmd.CommandTimeout := self.CommandTimeout;
180
    cmd.Execute;
186
    cmd.Execute;
181
  finally
187
  finally
182
    cmd.Free;
188
    cmd.Free;
183
  end;
189
  end;
184
end;
190
end;
Line 187... Line 193...
187
var
193
var
188
  s: string;
194
  s: string;
189
begin
195
begin
190
  for s in List do
196
  for s in List do
191
  begin
197
  begin
192
    ExecSQL(s);
198
    ExecSQL(s, ATimeout);
193
  end;
199
  end;
194
end;
200
end;
195
 
201
 
196
function TAdoConnectionHelper.FieldCount(aTableName: string): integer;
202
function TAdoConnectionHelper.FieldCount(aTableName: string): integer;
197
begin
203
begin