]> git.saurik.com Git - wxWidgets.git/blob - demos/dbbrowse/browsedb.cpp
Applied patch [ 825396 ] dbbrowse demo compatible with Unicode
[wxWidgets.git] / demos / dbbrowse / browsedb.cpp
1 //----------------------------------------------------------------------------------------
2 // Name: BrowserDB.h,cpp
3 // Purpose: a wxDB class
4 // Author: Mark Johnson
5 // Modified by:
6 // Created: 19991127.mj10777
7 // Copyright: (c) Mark Johnson
8 // Licence: wxWindows license
9 // RCS-ID: $Id$
10 //----------------------------------------------------------------------------------------
11 //-- 1)
12 //----------------------------------------------------------------------------------------
13 //-- all #ifdefs that the whole Project needs. -------------------------------------------
14 //----------------------------------------------------------------------------------------
15 #ifdef __GNUG__
16 #pragma implementation
17 #pragma interface
18 #endif
19 //----------------------------------------------------------------------------------------
20 // For compilers that support precompilation, includes "wx/wx.h".
21 #include "wx/wxprec.h"
22 //----------------------------------------------------------------------------------------
23 #ifdef __BORLANDC__
24 #pragma hdrstop
25 #endif
26 //----------------------------------------------------------------------------------------
27 #ifndef WX_PRECOMP
28 #include "wx/wx.h"
29 #endif
30 //----------------------------------------------------------------------------------------
31 #include "std.h"
32 //----------------------------------------------------------------------------------------
33 // Global structure for holding ODBC connection information
34 wxDbConnectInf DbConnectInf;
35
36 #if !wxUSE_ODBC
37 #error Demo cannot be compiled unless setup.h has wxUSE_ODBC set to 1
38 #endif
39
40 //----------------------------------------------------------------------------------------
41 extern WXDLLEXPORT_DATA(wxDbList*) PtrBegDbList; /* from db.cpp, used in getting back error results from db connections */
42
43 //----------------------------------------------------------------------------------------
44 wxChar *GetExtendedDBErrorMsg(wxChar *ErrFile, int ErrLine)
45 {
46 static wxString msg;
47 wxString tStr;
48 if (ErrFile || ErrLine)
49 {
50 msg += _T("File: ");
51 msg += ErrFile;
52 msg += _T(" Line: ");
53 tStr.Printf(_T("%d"),ErrLine);
54 msg += tStr.GetData();
55 // msg += _T("\n");
56 }
57 msg.Append (_T("\nODBC errors:\n"));
58 // msg += _T("\n");
59 /* Scan through each database connection displaying
60 * any ODBC errors that have occured. */
61 wxDbList *pDbList;
62 for (pDbList = PtrBegDbList; pDbList; pDbList = pDbList->PtrNext)
63 {
64 // Skip over any free connections
65 if (pDbList->Free)
66 continue;
67 // Display errors for this connection
68 for (int i = 0; i < DB_MAX_ERROR_HISTORY; i++)
69 {
70 if (pDbList->PtrDb->errorList[i])
71 {
72 msg.Append(pDbList->PtrDb->errorList[i]);
73 if (wxStrcmp(pDbList->PtrDb->errorList[i],_T("")) != 0)
74 msg.Append(_T("\n"));
75 }
76 }
77 }
78 msg += _T("\n");
79 return (wxChar*) (const wxChar*) msg;
80 } // GetExtendedDBErrorMsg
81
82 //----------------------------------------------------------------------------------------
83 BrowserDB::BrowserDB()
84 {
85 PointerToNULL(0);
86 ODBCSource = _T(""); // ODBC data source name (created with ODBC Administrator under Win95/NT)
87 UserName = _T(""); // database username - must already exist in the data source
88 Password = _T(""); // password database username
89 OnFillSqlTyp();
90 OnFilldbTyp();
91 } // BrowserDB Constructor
92
93 //----------------------------------------------------------------------------------------
94 BrowserDB::~BrowserDB()
95 {
96 PointerToNULL(1); // Clean up Tables and Databases (Commit, Close and delete)
97 } // BrowserDB destructor
98
99 //----------------------------------------------------------------------------------------
100 bool BrowserDB::Initialize(int Quiet)
101 {
102 if (!OnStartDB(Quiet))
103 {
104 wxLogMessage(_("\n\n-E-> BrowserDB::OnStartDB(%s) : Failed ! "),ODBCSource.c_str());
105 return FALSE;
106 }
107 return TRUE;
108 } // BrowserDB:Initialize
109
110 //----------------------------------------------------------------------------------------
111 bool BrowserDB::OnStartDB(int Quiet)
112 {
113 wxStopWatch sw;
114 if (!Quiet)
115 wxLogMessage(_("\n-I-> BrowserDB::OnStartDB(%s) : Begin "),ODBCSource.c_str());
116 if (db_BrowserDB != NULL)
117 {
118 if (!Quiet)
119 wxLogMessage(_("\n-I-> BrowserDB::OnStartDB() : DB is already open."));
120 return TRUE;
121 }
122
123 DbConnectInf.AllocHenv();
124
125 //---------------------------------------------------------------------------------------
126 // Connect to datasource
127 //---------------------------------------------------------------------------------------
128 DlgUser *p_Dlg;
129 p_Dlg = new DlgUser(pDoc->p_MainFrame,pDoc,_T(""));
130 p_Dlg->s_DSN = ODBCSource;
131 p_Dlg->s_User = UserName;
132 p_Dlg->s_Password = Password;
133 p_Dlg->OnInit();
134 p_Dlg->Fit();
135
136 bool OK = FALSE;
137 if (p_Dlg->ShowModal() == wxID_OK)
138 {
139 (pDoc->p_DSN+i_Which)->Usr = p_Dlg->s_User;
140 (pDoc->p_DSN+i_Which)->Pas = p_Dlg->s_Password;
141 UserName = p_Dlg->s_User;
142 Password = p_Dlg->s_Password;
143 OK = TRUE;
144 }
145 delete p_Dlg;
146 if (OK)
147 {
148 //--------------------------------------------------------------------------------------
149 DbConnectInf.SetDsn(ODBCSource); // ODBC data source name (created with ODBC Administrator under Win95/NT)
150 DbConnectInf.SetUserID(UserName); // database username - must already exist in the data source
151 DbConnectInf.SetPassword(Password); // password database username
152 db_BrowserDB = wxDbGetConnection(&DbConnectInf);
153 // wxLogMessage(">>>%s<<<>>>%s<<<",UserName.c_str(),Password.c_str());
154 if (db_BrowserDB == NULL)
155 {
156 DbConnectInf.SetDsn(wxT(""));
157 DbConnectInf.SetUserID(wxT(""));
158 DbConnectInf.SetPassword(wxT(""));
159 if (!Quiet)
160 {
161 wxLogMessage(_("\n-E-> BrowserDB::OnConnectDataSource() DB CONNECTION ERROR : Unable to connect to the data source.\n\nCheck the name of your data source to verify it has been correctly entered/spelled.\n\nWith some databases, the user name and password must\nbe created with full rights to the table prior to making a connection\n(using tools provided by the database manufacturer)"));
162 wxLogMessage(_("-I-> BrowserDB::OnStartDB(%s) : End - Time needed : %ld ms"),ODBCSource.c_str(),sw.Time());
163 }
164 DbConnectInf.FreeHenv();
165 return FALSE;
166 }
167 //--------------------------------------------------------------------------------------
168 if (!Quiet)
169 {
170 Temp1 = db_BrowserDB->GetDatabaseName();
171 Temp2 = db_BrowserDB->GetDataSource();
172 wxLogMessage(_("-I-> BrowserDB::OnGetDataSourceODBC() - DatabaseName(%s) ; DataSource(%s)"),Temp1.c_str(),Temp2.c_str());
173 wxLogMessage(_("-I-> BrowserDB::OnStartDB(%s) : End - Time needed : %ld ms"),ODBCSource.c_str(),sw.Time());
174 }
175 return TRUE;
176 }
177 else
178 {
179 DbConnectInf.FreeHenv();
180 return FALSE;
181 }
182 }
183
184 //----------------------------------------------------------------------------------------
185 bool BrowserDB::OnCloseDB(int Quiet)
186 {
187 if (!Quiet)
188 wxLogMessage(_("-I-> BrowserDB::OnCloseDB() : Begin "));
189 if (db_BrowserDB)
190 {
191 // db_BrowserDB->Close();
192 wxDbFreeConnection(db_BrowserDB);
193
194 DbConnectInf.FreeHenv();
195
196 db_BrowserDB = NULL;
197 }
198 if (!Quiet)
199 wxLogMessage(_("\n-I-> BrowserDB::OnCloseDB() : End "));
200 return TRUE;
201 }
202
203 //----------------------------------------------------------------------------------------
204 bool BrowserDB::OnGetNext(int Cols,int Quiet)
205 {
206 SDWORD cb;
207 int i_dbDataType;
208 int i=0;
209 wxChar s_temp[1024+1];
210 long l_temp;
211 double f_temp;
212 int AnzError=0;
213 TIMESTAMP_STRUCT t_temp;
214 wxString Temp0;
215 //-----------------------------
216 if (!db_BrowserDB->GetNext())
217 {
218 return FALSE;
219 Temp0.Printf(_("\n-E-> BrowserDB::OnGetNext - ODBC-Error with GetNext \n-E-> "));
220 Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__);
221 wxLogMessage(Temp0);
222 wxMessageBox(Temp0);
223 }
224 else
225 {
226 for (i=0;i<Cols;i++)
227 {
228 wxStrcpy((cl_BrowserDB+i)->tableName,_T("-E->"));
229 i_dbDataType = (cl_BrowserDB+i)->pColFor->i_dbDataType;
230 if (i_dbDataType == 0) // Filter unsupported dbDataTypes
231 {
232 if (((cl_BrowserDB+i)->pColFor->i_sqlDataType == SQL_VARCHAR) ||
233 ((cl_BrowserDB+i)->pColFor->i_sqlDataType == SQL_LONGVARCHAR))
234 i_dbDataType = DB_DATA_TYPE_VARCHAR;
235 if ((cl_BrowserDB+i)->pColFor->i_sqlDataType == SQL_C_DATE)
236 i_dbDataType = DB_DATA_TYPE_DATE;
237 if ((cl_BrowserDB+i)->pColFor->i_sqlDataType == SQL_C_BIT)
238 i_dbDataType = DB_DATA_TYPE_INTEGER;
239 if ((cl_BrowserDB+i)->pColFor->i_sqlDataType == SQL_NUMERIC)
240 i_dbDataType = DB_DATA_TYPE_VARCHAR;
241 if ((cl_BrowserDB+i)->pColFor->i_sqlDataType == SQL_REAL)
242 i_dbDataType = DB_DATA_TYPE_FLOAT;
243 }
244 if ((i_dbDataType == DB_DATA_TYPE_INTEGER) &&
245 ((cl_BrowserDB+i)->pColFor->i_sqlDataType == SQL_C_DOUBLE))
246 { // DBASE Numeric
247 i_dbDataType = DB_DATA_TYPE_FLOAT;
248 }
249 switch(i_dbDataType)
250 {
251 case DB_DATA_TYPE_VARCHAR:
252 wxStrcpy(s_temp,_T(""));
253 if (!db_BrowserDB->GetData(i+1,(cl_BrowserDB+i)->pColFor->i_dbDataType,&s_temp,sizeof(s_temp), &cb))
254 {
255 Temp0.Printf(_("\n-E-> BrowserDB::OnGetNext - ODBC-Error with GetNext of >%s<.\n-E-> "),(cl_BrowserDB+i)->tableName);
256 Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__);
257 wxLogMessage(Temp0);
258 }
259 Temp0.Printf((cl_BrowserDB+i)->pColFor->s_Field,s_temp);
260 wxStrcpy((cl_BrowserDB+i)->tableName,Temp0.c_str());
261 break;
262 case DB_DATA_TYPE_INTEGER:
263 l_temp = 0;
264 if (!db_BrowserDB->GetData(i+1,(cl_BrowserDB+i)->pColFor->i_sqlDataType,&l_temp,sizeof(l_temp), &cb))
265 {
266 Temp0.Printf(_("\n-E-> BrowserDB::OnGetData - ODBC-Error with GetNext \n-E-> "));
267 Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__);
268 }
269 else
270 {
271 Temp0.Printf((cl_BrowserDB+i)->pColFor->s_Field,l_temp);
272 wxStrcpy((cl_BrowserDB+i)->tableName,Temp0.c_str());
273 }
274 break;
275 case DB_DATA_TYPE_FLOAT:
276 f_temp = 0;
277 if (!db_BrowserDB->GetData(i+1,(cl_BrowserDB+i)->pColFor->i_sqlDataType,&f_temp,sizeof(f_temp), &cb))
278 {
279 Temp0.Printf(_("\n-E-> BrowserDB::OnGetData - ODBC-Error with GetNext \n-E-> "));
280 Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__);
281 wxMessageBox(Temp0);
282 }
283 else
284 {
285 Temp0.Printf((cl_BrowserDB+i)->pColFor->s_Field,f_temp);
286 wxStrcpy((cl_BrowserDB+i)->tableName,Temp0.c_str());
287 }
288 break;
289 case DB_DATA_TYPE_DATE:
290 t_temp.day = t_temp.month = t_temp.year = t_temp.hour = t_temp.minute = t_temp.second = t_temp.fraction = 0;
291 if (!db_BrowserDB->GetData(i+1,(cl_BrowserDB+i)->pColFor->i_sqlDataType,&t_temp,sizeof(t_temp), &cb))
292 {
293 Temp0.Printf(_("\n-E-> BrowserDB::OnGetData - ODBC-Error with GetNext \n-E-> "));
294 Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__);
295 }
296 else
297 {
298 // i_Nation = 0 = timestamp , 1=EU, 2=UK, 3=International, 4=US
299 if (((cl_BrowserDB+i)->pColFor->i_Nation == 0) || // TS YYYY-MM-DD
300 ((cl_BrowserDB+i)->pColFor->i_Nation == 3)) // IT YYYY-MM-DD
301 {
302 Temp0.Printf((cl_BrowserDB+i)->pColFor->s_Field,t_temp.year,t_temp.month,t_temp.day,
303 t_temp.hour, t_temp.minute, t_temp.second, t_temp.fraction);
304 wxStrcpy((cl_BrowserDB+i)->tableName,Temp0.c_str());
305 }
306 if (((cl_BrowserDB+i)->pColFor->i_Nation == 1) || // EU DD.MM.YYYY
307 ((cl_BrowserDB+i)->pColFor->i_Nation == 2)) // UK DD/MM/YYYY
308 {
309 Temp0.Printf((cl_BrowserDB+i)->pColFor->s_Field,t_temp.day,t_temp.month,t_temp.year,
310 t_temp.hour, t_temp.minute, t_temp.second, t_temp.fraction);
311 wxStrcpy((cl_BrowserDB+i)->tableName,Temp0.c_str());
312 }
313 if ((cl_BrowserDB+i)->pColFor->i_Nation == 3) // US MM/DD/YYYY
314 {
315 Temp0.Printf((cl_BrowserDB+i)->pColFor->s_Field,t_temp.month,t_temp.day,t_temp.year,
316 t_temp.hour, t_temp.minute, t_temp.second, t_temp.fraction);
317 wxStrcpy((cl_BrowserDB+i)->tableName,Temp0.c_str());
318 }
319 }
320 break;
321 default:
322 AnzError++;
323 if (AnzError <= 100)
324 {
325 Temp0 = (cl_BrowserDB+i)->colName;
326 wxLogMessage(_("-E-> BrowserDB::OnGetNext - DB_DATA_TYPE_?? (%d) in Col(%s)"),(cl_BrowserDB+i)->pColFor->i_dbDataType,Temp0.c_str());
327 }
328 else
329 return TRUE;
330 Temp0.Printf(_("-E-> unknown Format(%d) - sql(%d)"),(cl_BrowserDB+i)->pColFor->i_dbDataType,(cl_BrowserDB+i)->pColFor->i_sqlDataType);
331 wxStrcpy((cl_BrowserDB+i)->tableName,Temp0.c_str());
332 break;
333 }; // switch
334 } // for
335 } // else
336
337 return TRUE;
338 }
339
340 //----------------------------------------------------------------------------------------
341 bool BrowserDB::OnSelect(wxString tb_Name, int Quiet)
342 {
343 wxStopWatch sw;
344 wxString SQLStmt;
345 i_Records = 0;
346 //---------------------------------------------------------------------------------------
347 SQLStmt.sprintf(_T("SELECT * FROM %s"),db_BrowserDB->SQLTableName(tb_Name.c_str()));
348 if (!db_BrowserDB->ExecSql((wxChar *)(SQLStmt.GetData())))
349 {
350 Temp0.Printf(_("\n-E-> BrowserDB::OnSelect - ODBC-Error with ExecSql of >%s<.\n-E-> "),tb_Name.c_str());
351 Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__);
352 wxLogMessage(Temp0);
353 wxMessageBox(_T("-E-> BrowserDB::OnSelect - GetData()"));
354 return FALSE;
355 }
356 //---------------------------------------------------------------------------------------
357 while (db_BrowserDB->GetNext())
358 {
359 i_Records++;
360 }
361 //---------------------------------------------------------------------------------------
362 if (!db_BrowserDB->ExecSql((wxChar *)(SQLStmt.GetData())))
363 {
364 Temp0.Printf(_("\n-E-> BrowserDB::OnSelect - ODBC-Error with ExecSql of >%s<.\n-E-> "),tb_Name.c_str());
365 Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__);
366 wxLogMessage(Temp0);
367 return FALSE;
368 }
369 //---------------------------------------------------------------------------------------
370 // SetColDefs ( 0,"NAME", DB_DATA_TYPE_VARCHAR, Name, SQL_C_CHAR, sizeof(Name), TRUE, TRUE); // Primary index
371 //---------------------------------------------------------------------------------------
372 if (!Quiet)
373 {
374 wxLogMessage(_("\n-I-> BrowserDB::OnSelect(%s) Records(%d): End - Time needed : %ld ms"),tb_Name.c_str(),i_Records,sw.Time());
375 }
376 return TRUE;
377 }
378
379 //----------------------------------------------------------------------------------------
380 bool BrowserDB::OnExecSql(wxString SQLStmt, int Quiet)
381 {
382 //---------------------------------------------------------------------------------------
383 if (!db_BrowserDB->ExecSql((wxChar *)(SQLStmt.GetData())))
384 {
385 Temp0.Printf(_("\n-E-> BrowserDB::OnExecSQL - ODBC-Error with ExecSql of >%s<.\n-E-> "),SQLStmt.c_str());
386 Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__);
387 if (!Quiet)
388 wxLogMessage(Temp0);
389 else
390 wxMessageBox(_T("-E-> BrowserDB::OnExecSql - ExecSql()"));
391 return FALSE;
392 }
393 if (!Quiet)
394 {
395 // wxLogMessage(_("\n-I-> BrowserDB::OnExecSql(%s) - End - Time needed : %ld ms"),SQLStmt.c_str(),sw.Time());
396 }
397 return TRUE;
398 }
399
400 //----------------------------------------------------------------------------------------
401 wxDbInf* BrowserDB::OnGetCatalog(int Quiet)
402 {
403 wxChar UName[255];
404 wxStrcpy(UName,UserName);
405 ct_BrowserDB = db_BrowserDB->GetCatalog(UName);
406 return ct_BrowserDB;
407 }
408
409 //----------------------------------------------------------------------------------------
410 wxDbColInf* BrowserDB::OnGetColumns(wxChar *tableName, UWORD numCols, int Quiet)
411 {
412 wxChar UName[255];
413 int i;
414 wxStrcpy(UName,UserName);
415 cl_BrowserDB = db_BrowserDB->GetColumns(tableName,&numCols,UName);
416 // cl_BrowserDB->pColFor = new wxDbColFor[numCols];
417 for (i=0;i<numCols;i++)
418 {
419 // (cl_BrowserDB->pColFor+i)->Format(1,(cl_BrowserDB+i)->dbDataType,(cl_BrowserDB+i)->sqlDataType,
420 // (cl_BrowserDB+i)->columnSize, (cl_BrowserDB+i)->decimalDigits);
421 (cl_BrowserDB+i)->pColFor = new wxDbColFor;
422 (cl_BrowserDB+i)->pColFor->Format(1,
423 (cl_BrowserDB+i)->dbDataType,
424 (cl_BrowserDB+i)->sqlDataType,
425 (cl_BrowserDB+i)->columnSize,
426 (cl_BrowserDB+i)->decimalDigits);
427 }
428 return cl_BrowserDB;
429 }
430
431 //----------------------------------------------------------------------------------------
432 void BrowserDB::PointerToNULL(int Art)
433 {
434 if (Art == 1) // Löschen
435 {
436 if (cl_BrowserDB != NULL)
437 { // Destroy the memory
438 delete [] cl_BrowserDB;
439 }
440 if (ct_BrowserDB != NULL)
441 { // Destroy the memory
442 delete [] ct_BrowserDB;
443 }
444 if (db_BrowserDB != NULL)
445 {
446 db_BrowserDB->CommitTrans();
447 db_BrowserDB->Close();
448 wxDbCloseConnections();
449 delete db_BrowserDB;
450 }
451 }
452 cl_BrowserDB = NULL;
453 ct_BrowserDB = NULL;
454 db_BrowserDB = NULL;
455 p_LogWindow = NULL;
456 }
457
458 //----------------------------------------------------------------------------------------
459 void BrowserDB::OnFillSqlTyp()
460 {
461 i_SqlTyp[1] = SQL_C_BINARY; s_SqlTyp[1] = _T("SQL_C_BINARY");
462 i_SqlTyp[2] = SQL_C_BIT; s_SqlTyp[2] = _T("SQL_C_BIT");
463 i_SqlTyp[3] = SQL_C_BOOKMARK; s_SqlTyp[3] = _T("SQL_C_BOOKMARK");
464 i_SqlTyp[4] = SQL_C_CHAR; s_SqlTyp[4] = _T("SQL_C_CHAR");
465 i_SqlTyp[5] = SQL_C_DATE; s_SqlTyp[5] = _T("SQL_C_DATE");
466 i_SqlTyp[6] = SQL_C_DEFAULT; s_SqlTyp[6] = _T("SQL_C_DEFAULT");
467 i_SqlTyp[7] = SQL_C_DOUBLE; s_SqlTyp[7] = _T("SQL_C_DOUBLE");
468 i_SqlTyp[8] = SQL_C_FLOAT; s_SqlTyp[8] = _T("SQL_C_FLOAT");
469 i_SqlTyp[9] = SQL_C_LONG; s_SqlTyp[9] = _T("SQL_C_LONG");
470 i_SqlTyp[10] = SQL_C_SHORT; s_SqlTyp[10] = _T("SQL_C_SHORT");
471 i_SqlTyp[11] = SQL_C_SLONG; s_SqlTyp[11] = _T("SQL_C_SLONG");
472 i_SqlTyp[12] = SQL_C_SSHORT; s_SqlTyp[12] = _T("SQL_C_SSHORT");
473 i_SqlTyp[13] = SQL_C_STINYINT; s_SqlTyp[13] = _T("SQL_C_STINYINT");
474 i_SqlTyp[14] = SQL_C_TIME; s_SqlTyp[14] = _T("SQL_C_TIME");
475 i_SqlTyp[15] = SQL_C_TIMESTAMP; s_SqlTyp[15] = _T("SQL_C_TIMESTAMP");
476 i_SqlTyp[16] = SQL_C_TINYINT; s_SqlTyp[16] = _T("SQL_C_TINYINT");
477 i_SqlTyp[17] = SQL_C_ULONG; s_SqlTyp[17] = _T("SQL_C_ULONG");
478 i_SqlTyp[18] = SQL_C_USHORT; s_SqlTyp[18] = _T("SQL_C_USHORT");
479 i_SqlTyp[19] = SQL_C_UTINYINT; s_SqlTyp[19] = _T("SQL_C_UTINYINT");
480 i_SqlTyp[20] = SQL_VARCHAR; s_SqlTyp[20] = _T("SQL_VARCHAR");
481 i_SqlTyp[21] = SQL_NUMERIC; s_SqlTyp[21] = _T("SQL_NUMERIC");
482 i_SqlTyp[22] = SQL_LONGVARCHAR; s_SqlTyp[22] = _T("SQL_LONGVARCHAR");
483 i_SqlTyp[23] = SQL_REAL; s_SqlTyp[23] = _T("SQL_REAL");
484 i_SqlTyp[0] = 23; s_SqlTyp[0] = _T("");
485 }
486
487 //----------------------------------------------------------------------------------------
488 void BrowserDB::OnFilldbTyp()
489 {
490 i_dbTyp[1] = DB_DATA_TYPE_VARCHAR; s_dbTyp[1] = _T("DB_DATA_TYPE_VARCHAR");
491 i_dbTyp[2] = DB_DATA_TYPE_INTEGER; s_dbTyp[2] = _T("DB_DATA_TYPE_INTEGER");
492 i_dbTyp[3] = DB_DATA_TYPE_FLOAT; s_dbTyp[3] = _T("DB_DATA_TYPE_FLOAT");
493 i_dbTyp[4] = DB_DATA_TYPE_DATE; s_dbTyp[4] = _T("DB_DATA_TYPE_DATE");
494 i_dbTyp[0] = 4; s_dbTyp[0] = _T("");
495 }
496 //----------------------------------------------------------------------------------------