Changeset 348 for tools/dbc_export/DBCExport.pas
- Timestamp:
- Mar 1, 2010, 4:04:25 PM (15 years ago)
- Location:
- tools/dbc_export
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/dbc_export
- Property svn:ignore
-
old new 1 1 bin 2 2 *.bak 3 backup
-
- Property svn:ignore
-
tools/dbc_export/DBCExport.pas
r341 r348 27 27 IndexTable: array of integer; 28 28 SQLquery: string; 29 CharSet: string; 29 30 DisplayData: Boolean; 30 31 constructor Create(TheOwner: TComponent); override; … … 77 78 Database.Hostname := GetOptionValue('t', 'host'); 78 79 end else Database.Hostname := 'localhost'; 80 if HasOption('a', 'Charset') then begin 81 Charset := GetOptionValue('a', 'Charset'); 82 end else Charset := 'utf8'; 79 83 if HasOption('q', 'sql_query') then begin 80 84 SQLquery := GetOptionValue('q', 'sql_query'); … … 115 119 WriteLn('Usage: ', ExtractFileName(ExeName), ' [options]'); 116 120 WriteLn(' -h --help Show this help'); 117 WriteLn(' -u --user Database user name ');121 WriteLn(' -u --user Database user name, default root'); 118 122 WriteLn(' -p --password Database password name'); 119 WriteLn(' -s --schema Database schema name'); 120 WriteLn(' -t --host Database host name'); 123 WriteLn(' -s --schema Database schema name, default wowpreklad'); 124 WriteLn(' -t --host Database host name, default localhost'); 125 WriteLn(' -a --Charset Database Charset, default utf8'); 121 126 WriteLn(' -f --file Source DBC file name'); 122 127 WriteLn(' -n --newfile New created DBC file name'); … … 169 174 begin 170 175 with DBC do begin 171 SaveToFile(NewDBCFileName); 176 if FileExists(DBCFileName) then 177 SaveToFile(NewDBCFileName); 172 178 Free; 173 179 end; … … 185 191 with DBC do begin 186 192 if (SQLquery <> '') then begin; 193 187 194 Database.Connect; 195 // Database.Query('CHARACTER SET '+CharSet); 196 Database.Query('SET NAMES '+CharSet); 188 197 DBRows := Database.Query(SQLquery); 198 CharSet:=Database.Charset; 189 199 190 200 CreateIndexTable(DBRows);
Note:
See TracChangeset
for help on using the changeset viewer.