]>
git.saurik.com Git - wxWidgets.git/blob - demos/dbbrowse/browsedb.cpp
1 //---------------------------------------------------------------------------
2 // Name: BrowserDB.h,cpp
4 // Author: Mark Johnson, mj10777@gmx.net
6 // Created: 19991127.mj10777
7 // Copyright: (c) Mark Johnson
8 // Licence: wxWindows license
9 //---------------------------------------------------------------------------
11 //---------------------------------------------------------------------------
12 //-- all #ifdefs that the whole Project needs. ------------------------------
13 //---------------------------------------------------------------------------
15 #pragma implementation
18 //---------------------------------------------------------------------------
19 // For compilers that support precompilation, includes "wx/wx.h".
20 #include "wx/wxprec.h"
21 //---------------------------------------------------------------------------
25 //---------------------------------------------------------------------------
29 //---------------------------------------------------------------------------
30 #include <wx/dbtable.h>
32 //---------------------------------------------------------------------------
33 // Global structure for holding ODBC connection information
34 // - darf nur einmal im Projekte definiert werden ?? Extra Databasse Klasse ?
35 struct DbStuff ConnectInf
; // Für DBase
36 //---------------------------------------------------------------------------
37 extern DbList
* WXDLLEXPORT PtrBegDbList
; /* from db.cpp, used in getting back error results from db connections */
38 //---------------------------------------------------------------------------
39 char * GetExtendedDBErrorMsg ( char * ErrFile
, int ErrLine
)
43 if ( ErrFile
|| ErrLine
)
48 tStr
. Printf ( " %d " , ErrLine
);
49 msg
+= tStr
. GetData ();
52 msg
. Append ( " \n ODBC errors: \n " );
54 /* Scan through each database connection displaying
55 * any ODBC errors that have occured. */
56 for ( DbList
* pDbList
= PtrBegDbList
; pDbList
; pDbList
= pDbList
-> PtrNext
)
58 // Skip over any free connections
61 // Display errors for this connection
62 for ( int i
= 0 ; i
< DB_MAX_ERROR_HISTORY
; i
++)
64 if ( pDbList
-> PtrDb
-> errorList
[ i
])
66 msg
. Append ( pDbList
-> PtrDb
-> errorList
[ i
]);
67 if ( strcmp ( pDbList
-> PtrDb
-> errorList
[ i
], "" ) != 0 )
73 return ( char *) ( const char *) msg
;
74 } // GetExtendedDBErrorMsg
75 //////////////////////////////////////////////////////////////////////////////////
76 // BJO 20000115 : New stuff : dialog to ask for username and password
77 //////////////////////////////////////////////////////////////////////////////////
78 class UserDialog
: public wxDialog
81 UserDialog ( wxWindow
* parent
);
82 virtual ~ UserDialog ();
83 void OnOK ( wxCommandEvent
& event
);
84 wxString s_UserName
, s_Password
;
88 wxStaticText
* m_Label1
, * m_Label2
;
89 wxTextCtrl
* m_UserName
, * m_Password
;
94 //---------------------------------------------------------------------------
95 BEGIN_EVENT_TABLE ( UserDialog
, wxDialog
)
96 EVT_BUTTON ( wxID_OK
, UserDialog :: OnOK
)
98 //---------------------------------------------------------------------------
99 UserDialog :: UserDialog ( wxWindow
* parent
):
100 wxDialog ( parent
, - 1 , _ ( "ODBC user" ), wxDefaultPosition
, wxSize ( 310 , 300 ), wxDIALOG_MODAL
| wxDEFAULT_DIALOG_STYLE
)
102 wxLayoutConstraints
* layout
;
104 //-----------------------------------------------
105 m_OK
= new wxButton ( this , wxID_OK
, _ ( "Ok" ));
106 layout
= new wxLayoutConstraints
;
107 layout
-> left
. SameAs ( this , wxLeft
, 10 );
108 layout
-> top
. SameAs ( this , wxTop
, 10 );
109 layout
-> height
. AsIs ();
110 layout
-> width
. Absolute ( 75 );
111 m_OK
-> SetConstraints ( layout
);
113 m_Label1
= new wxStaticText ( this , - 1 , _ ( "User name:" ));
114 layout
= new wxLayoutConstraints
;
115 layout
-> left
. SameAs ( m_OK
, wxLeft
);
116 layout
-> top
. SameAs ( m_OK
, wxBottom
, 10 );
117 layout
-> height
. AsIs ();
118 layout
-> width
. AsIs ();
119 m_Label1
-> SetConstraints ( layout
);
121 m_UserName
= new wxTextCtrl ( this , - 1 , "" );
122 layout
= new wxLayoutConstraints
;
123 layout
-> left
. SameAs ( m_OK
, wxLeft
);
124 layout
-> top
. SameAs ( m_Label1
, wxBottom
, 3 );
125 layout
-> width
. AsIs ();
126 layout
-> height
. AsIs ();
127 m_UserName
-> SetConstraints ( layout
);
129 m_Label2
= new wxStaticText ( this , - 1 , _ ( "Password:" ));
130 layout
= new wxLayoutConstraints
;
131 layout
-> left
. SameAs ( m_OK
, wxLeft
);
132 layout
-> top
. SameAs ( m_UserName
, wxBottom
, 10 );
133 layout
-> height
. AsIs ();
134 layout
-> width
. AsIs ();
135 m_Label2
-> SetConstraints ( layout
);
137 m_Password
= new wxTextCtrl ( this , - 1 , "" , wxDefaultPosition
, wxDefaultSize
, wxTE_PASSWORD
);
138 layout
= new wxLayoutConstraints
;
139 layout
-> left
. SameAs ( m_OK
, wxLeft
);
140 layout
-> width
. AsIs ();
141 layout
-> top
. SameAs ( m_Label2
, wxBottom
, 3 );
142 layout
-> height
. AsIs ();
143 m_Password
-> SetConstraints ( layout
);
150 //---------------------------------------------------------------------------
151 UserDialog ::~ UserDialog ()
154 //---------------------------------------------------------------------------
155 void UserDialog :: OnOK ( wxCommandEvent
& WXUNUSED ( event
))
157 strcpy ( ConnectInf
. Uid
, m_UserName
-> GetValue ());
158 strcpy ( ConnectInf
. AuthStr
, m_Password
-> GetValue ());
161 //////////////////////////////////////////////////////////////////////////////////
162 // BJO 20000115 : end of new stuff
163 //////////////////////////////////////////////////////////////////////////////////
164 //---------------------------------------------------------------------------
165 BrowserDB :: BrowserDB ()
168 ODBCSource
= "" ; // ODBC data source name (created with ODBC Administrator under Win95/NT)
169 UserName
= "" ; // database username - must already exist in the data source
170 Password
= "" ; // password database username
173 } // BrowserDB Constructor
174 //---------------------------------------------------------------------------
175 BrowserDB ::~ BrowserDB ()
177 Zeiger_auf_NULL ( 1 ); // Clean up Tables and Databases (Commit, Close und delete)
178 } // BrowserDB destructor
179 //--------------------------------------------------------------------------------------------
180 bool BrowserDB :: Initialize ( int Quite
)
182 if (! OnStartDB ( Quite
))
184 wxLogMessage ( _ ( " \n\n -E-> BrowserDB::OnStartDB( %s ) : Failed ! " ), ODBCSource
. c_str ());
188 } // BrowserDB:Initialize
189 //--------------------------------------------------------------------------------------------
190 bool BrowserDB :: OnStartDB ( int Quite
)
193 wxLogMessage ( _ ( " \n -I-> BrowserDB::OnStartDB( %s ) : Begin " ), ODBCSource
. c_str ());
194 if ( db_BrowserDB
!= NULL
)
197 wxLogMessage ( _ ( " \n -I-> BrowserDB::OnStartDB() : DB is allready open." ));
200 // Initialize the ODBC Environment for Database Operations
201 if ( SQLAllocEnv (& ConnectInf
. Henv
) != SQL_SUCCESS
)
204 wxLogMessage ( _ ( " \n -E-> BrowserDB::OnStartDB() : DB CONNECTION ERROR : A problem occured while trying to get a connection to the data source" ));
207 //---------------------------------------------------------------------------
208 // Connect to datasource
209 //---------------------------
210 DlgUser
p_Dlg ( pDoc
-> p_MainFrame
, "Username and Password" , wxPoint ( 100 , 100 ), wxSize ( 340 , 170 ));
211 p_Dlg
. s_DSN
= ODBCSource
;
212 p_Dlg
. s_User
= UserName
;
213 p_Dlg
. s_Password
= Password
;
215 if ( p_Dlg
. ShowModal () == wxID_OK
)
217 ( pDoc
-> p_DSN
+ i_Which
)-> Usr
= p_Dlg
. s_User
;
218 ( pDoc
-> p_DSN
+ i_Which
)-> Pas
= p_Dlg
. s_Password
;
219 UserName
= p_Dlg
. s_User
;
220 Password
= p_Dlg
. s_Password
;
223 //---------------------------
224 strcpy ( ConnectInf
. Dsn
, ODBCSource
); // ODBC data source name (created with ODBC Administrator under Win95/NT)
225 strcpy ( ConnectInf
. Uid
, UserName
); // database username - must already exist in the data source
226 strcpy ( ConnectInf
. AuthStr
, Password
); // password database username
227 db_BrowserDB
= GetDbConnection (& ConnectInf
);
228 // wxLogMessage(">>>%s<<<>>>%s<<<",UserName.c_str(),Password.c_str());
229 if ( db_BrowserDB
== NULL
)
231 strcpy ( ConnectInf
. Dsn
, "" );
232 strcpy ( ConnectInf
. Uid
, "" );
233 strcpy ( ConnectInf
. AuthStr
, "" );
236 wxLogMessage ( _ ( " \n -E-> BrowserDB::OnConnectDataSource() DB CONNECTION ERROR : Unable to connect to the data source. \n\n Check the name of your data source to verify it has been correctly entered/spelled. \n\n With some databases, the user name and password must \n be created with full rights to the table prior to making a connection \n (using tools provided by the database manufacturer)" ));
237 wxLogMessage ( _ ( "-I-> BrowserDB::OnStartDB( %s ) : End " ), ODBCSource
. c_str ());
241 //--------------------------------------------------------------------------
244 Temp1
= db_BrowserDB
-> GetDatabaseName ();
245 Temp2
= db_BrowserDB
-> GetDataSource ();
246 wxLogMessage ( _ ( "-I-> BrowserDB::OnGetDataSourceODBC() - DatabaseName( %s ) ; DataSource( %s )" ), Temp1
. c_str (), Temp2
. c_str ());
247 wxLogMessage ( _ ( "-I-> BrowserDB::OnStartDB( %s ) : End " ), ODBCSource
. c_str ());
251 //--------------------------------------------------------------------------------------------
252 bool BrowserDB :: OnCloseDB ( int Quite
)
255 wxLogMessage ( _ ( "-I-> BrowserDB::OnCloseDB() : Begin " ));
258 db_BrowserDB
-> Close ();
259 FreeDbConnection ( db_BrowserDB
);
261 // Free Environment Handle that ODBC uses
262 if ( SQLFreeEnv (& ConnectInf
. Henv
) != SQL_SUCCESS
)
264 // Error freeing environment handle
269 wxLogMessage ( _ ( " \n -I-> BrowserDB::OnCloseDB() : End " ));
272 //----------------------------------------------------------------------------------------
273 bool BrowserDB :: OnGetNext ( int Cols
, int Quite
)
282 TIMESTAMP_STRUCT t_temp
;
284 //-----------------------------
285 if (! db_BrowserDB
-> GetNext ())
288 Temp0
. Printf ( _ ( " \n -E-> BrowserDB::OnGetNext - ODBC-Error with GetNext \n -E-> " ));
289 Temp0
+= GetExtendedDBErrorMsg ( __FILE__
, __LINE__
);
297 strcpy (( cl_BrowserDB
+ i
)-> tableName
, "-E->" );
298 i_dbDataType
= ( cl_BrowserDB
-> pColFor
+ i
)-> i_dbDataType
;
299 if ( i_dbDataType
== 0 ) // Filter unsupported dbDataTypes
301 if ((( cl_BrowserDB
-> pColFor
+ i
)-> i_sqlDataType
== SQL_VARCHAR
) || (( cl_BrowserDB
-> pColFor
+ i
)-> i_sqlDataType
== SQL_LONGVARCHAR
))
302 i_dbDataType
= DB_DATA_TYPE_VARCHAR
;
303 if (( cl_BrowserDB
-> pColFor
+ i
)-> i_sqlDataType
== SQL_C_DATE
)
304 i_dbDataType
= DB_DATA_TYPE_DATE
;
305 if (( cl_BrowserDB
-> pColFor
+ i
)-> i_sqlDataType
== SQL_C_BIT
)
306 i_dbDataType
= DB_DATA_TYPE_INTEGER
;
307 if (( cl_BrowserDB
-> pColFor
+ i
)-> i_sqlDataType
== SQL_NUMERIC
)
308 i_dbDataType
= DB_DATA_TYPE_VARCHAR
;
309 if (( cl_BrowserDB
-> pColFor
+ i
)-> i_sqlDataType
== SQL_REAL
)
310 i_dbDataType
= DB_DATA_TYPE_FLOAT
;
312 if (( i_dbDataType
== DB_DATA_TYPE_INTEGER
) && (( cl_BrowserDB
-> pColFor
+ i
)-> i_sqlDataType
== SQL_C_DOUBLE
))
314 i_dbDataType
= DB_DATA_TYPE_FLOAT
;
318 case DB_DATA_TYPE_VARCHAR
:
320 if (! db_BrowserDB
-> GetData ( i
+ 1 ,( cl_BrowserDB
-> pColFor
+ i
)-> i_dbDataType
,& s_temp
, sizeof ( s_temp
), & cb
))
322 Temp0
. Printf ( _ ( " \n -E-> BrowserDB::OnGetNext - ODBC-Error with GetNext of > %s <. \n -E-> " ),( cl_BrowserDB
+ i
)-> tableName
);
323 Temp0
+= GetExtendedDBErrorMsg ( __FILE__
, __LINE__
);
326 Temp0
. Printf (( cl_BrowserDB
-> pColFor
+ i
)-> s_Field
, s_temp
);
327 strcpy (( cl_BrowserDB
+ i
)-> tableName
, Temp0
. c_str ());
329 case DB_DATA_TYPE_INTEGER
:
331 if (! db_BrowserDB
-> GetData ( i
+ 1 ,( cl_BrowserDB
-> pColFor
+ i
)-> i_sqlDataType
,& l_temp
, sizeof ( l_temp
), & cb
))
333 Temp0
. Printf ( _ ( " \n -E-> BrowserDB::OnGetData - ODBC-Error with GetNext \n -E-> " ));
334 Temp0
+= GetExtendedDBErrorMsg ( __FILE__
, __LINE__
);
338 Temp0
. Printf (( cl_BrowserDB
-> pColFor
+ i
)-> s_Field
, l_temp
);
339 strcpy (( cl_BrowserDB
+ i
)-> tableName
, Temp0
. c_str ());
342 case DB_DATA_TYPE_FLOAT
:
344 if (! db_BrowserDB
-> GetData ( i
+ 1 ,( cl_BrowserDB
-> pColFor
+ i
)-> i_sqlDataType
,& f_temp
, sizeof ( f_temp
), & cb
))
346 Temp0
. Printf ( _ ( " \n -E-> BrowserDB::OnGetData - ODBC-Error with GetNext \n -E-> " ));
347 Temp0
+= GetExtendedDBErrorMsg ( __FILE__
, __LINE__
);
352 Temp0
. Printf (( cl_BrowserDB
-> pColFor
+ i
)-> s_Field
, f_temp
);
353 strcpy (( cl_BrowserDB
+ i
)-> tableName
, Temp0
. c_str ());
356 case DB_DATA_TYPE_DATE
:
357 t_temp
. day
= t_temp
. month
= t_temp
. year
= t_temp
. hour
= t_temp
. minute
= t_temp
. second
= t_temp
. fraction
= 0 ;
358 if (! db_BrowserDB
-> GetData ( i
+ 1 ,( cl_BrowserDB
-> pColFor
+ i
)-> i_sqlDataType
,& t_temp
, sizeof ( t_temp
), & cb
))
360 Temp0
. Printf ( _ ( " \n -E-> BrowserDB::OnGetData - ODBC-Error with GetNext \n -E-> " ));
361 Temp0
+= GetExtendedDBErrorMsg ( __FILE__
, __LINE__
);
365 // i_Nation = 0 = timestamp , 1=EU, 2=UK, 3=International, 4=US
366 if ((( cl_BrowserDB
-> pColFor
+ i
)-> i_Nation
== 0 ) || // TS YYYY-MM-DD
367 (( cl_BrowserDB
-> pColFor
+ i
)-> i_Nation
== 3 )) // IT YYYY-MM-DD
369 Temp0
. Printf (( cl_BrowserDB
-> pColFor
+ i
)-> s_Field
, t_temp
. year
, t_temp
. month
, t_temp
. day
,
370 t_temp
. hour
, t_temp
. minute
, t_temp
. second
, t_temp
. fraction
);
371 strcpy (( cl_BrowserDB
+ i
)-> tableName
, Temp0
. c_str ());
373 if ( (( cl_BrowserDB
-> pColFor
+ i
)-> i_Nation
== 1 ) || // EU DD.MM.YYYY
374 (( cl_BrowserDB
-> pColFor
+ i
)-> i_Nation
== 2 )) // UK DD/MM/YYYY
376 Temp0
. Printf (( cl_BrowserDB
-> pColFor
+ i
)-> s_Field
, t_temp
. day
, t_temp
. month
, t_temp
. year
,
377 t_temp
. hour
, t_temp
. minute
, t_temp
. second
, t_temp
. fraction
);
378 strcpy (( cl_BrowserDB
+ i
)-> tableName
, Temp0
. c_str ());
380 if (( cl_BrowserDB
-> pColFor
+ i
)-> i_Nation
== 3 ) // US MM/DD/YYYY
382 Temp0
. Printf (( cl_BrowserDB
-> pColFor
+ i
)-> s_Field
, t_temp
. month
, t_temp
. day
, t_temp
. year
,
383 t_temp
. hour
, t_temp
. minute
, t_temp
. second
, t_temp
. fraction
);
384 strcpy (( cl_BrowserDB
+ i
)-> tableName
, Temp0
. c_str ());
392 Temp0
= ( cl_BrowserDB
+ i
)-> colName
;
393 wxLogMessage ( _ ( "-E-> BrowserDB::OnGetNext - DB_DATA_TYPE_?? ( %d ) in Col( %s )" ),( cl_BrowserDB
-> pColFor
+ i
)-> i_dbDataType
, Temp0
. c_str ());
397 Temp0
. Printf ( _ ( "-E-> unknown Format( %d ) - sql( %d )" ),( cl_BrowserDB
-> pColFor
+ i
)-> i_dbDataType
,( cl_BrowserDB
-> pColFor
+ i
)-> i_sqlDataType
);
398 strcpy (( cl_BrowserDB
+ i
)-> tableName
, Temp0
. c_str ());
403 // wxLogMessage("-E-> BrowserDB::OnGetNext - End");
406 //----------------------------------------------------------------------------------------
407 bool BrowserDB :: OnSelect ( wxString tb_Name
, int Quite
)
411 //--------------------------------------------------------------------------
412 SQLStmt
. sprintf ( "SELECT * FROM %s " , tb_Name
. c_str ());
413 if (! db_BrowserDB
-> ExecSql (( char *)( SQLStmt
. GetData ())))
415 Temp0
. Printf ( _ ( " \n -E-> BrowserDB::OnSelect - ODBC-Error with ExecSql of > %s <. \n -E-> " ), tb_Name
. c_str ());
416 Temp0
+= GetExtendedDBErrorMsg ( __FILE__
, __LINE__
);
418 wxMessageBox ( "-E-> BrowserDB::OnSelect - GetData()" );
421 //--------------------------------------------------------------------------
422 while ( db_BrowserDB
-> GetNext ())
426 //--------------------------------------------------------------------------
427 if (! db_BrowserDB
-> ExecSql (( char *)( SQLStmt
. GetData ())))
429 Temp0
. Printf ( _ ( " \n -E-> BrowserDB::OnSelect - ODBC-Error with ExecSql of > %s <. \n -E-> " ), tb_Name
. c_str ());
430 Temp0
+= GetExtendedDBErrorMsg ( __FILE__
, __LINE__
);
434 //--------------------------------------------------------------------------
435 // SetColDefs ( 0,"NAME", DB_DATA_TYPE_VARCHAR, Name, SQL_C_CHAR, sizeof(Name), TRUE, TRUE); // Primary index
436 //--------------------------------------------------------------------------
439 wxLogMessage ( _ ( " \n -I-> BrowserDB::OnSelect( %s ) Records( %d ): End " ), tb_Name
. c_str (), i_Records
);
443 //----------------------------------------------------------------------------------------
444 bool BrowserDB :: OnExecSql ( wxString SQLStmt
, int Quite
)
446 //--------------------------------------------------------------------------
447 if (! db_BrowserDB
-> ExecSql (( char *)( SQLStmt
. GetData ())))
449 Temp0
. Printf ( _ ( " \n -E-> BrowserDB::OnExecSQL - ODBC-Error with ExecSql of > %s <. \n -E-> " ), SQLStmt
. c_str ());
450 Temp0
+= GetExtendedDBErrorMsg ( __FILE__
, __LINE__
);
454 wxMessageBox ( "-E-> BrowserDB::OnExecSql - ExecSql()" );
459 // wxLogMessage(_("\n-I-> BrowserDB::OnExecSql(%s) - End "),SQLStmt.c_str());
463 //----------------------------------------------------------------------------------------
464 wxDbInf
* BrowserDB :: OnGetCatalog ( int Quite
)
467 strcpy ( UName
, UserName
);
468 ct_BrowserDB
= db_BrowserDB
-> GetCatalog ( UName
);
471 //----------------------------------------------------------------------------------------
472 wxColInf
* BrowserDB :: OnGetColumns ( char * tableName
, int numCols
, int Quite
)
476 strcpy ( UName
, UserName
);
477 cl_BrowserDB
= db_BrowserDB
-> GetColumns ( tableName
,& numCols
, UName
);
478 cl_BrowserDB
-> pColFor
= new wxColFor
[ numCols
];
479 for ( i
= 0 ; i
< numCols
; i
++)
481 ( cl_BrowserDB
-> pColFor
+ i
)-> Format ( 1 ,( cl_BrowserDB
+ i
)-> dbDataType
,( cl_BrowserDB
+ i
)-> sqlDataType
,
482 ( cl_BrowserDB
+ i
)-> columnSize
, ( cl_BrowserDB
+ i
)-> decimalDigits
);
486 //----------------------------------------------------------------------------------------
487 void BrowserDB :: Zeiger_auf_NULL ( int Art
)
489 if ( Art
== 1 ) // Löschen
491 if ( cl_BrowserDB
!= NULL
)
492 { // Destroy the memory
493 delete [] cl_BrowserDB
;
495 if ( ct_BrowserDB
!= NULL
)
496 { // Destroy the memory
497 delete [] ct_BrowserDB
;
499 if ( db_BrowserDB
!= NULL
)
501 db_BrowserDB
-> CommitTrans ();
502 db_BrowserDB
-> Close ();
503 CloseDbConnections ();
512 //----------------------------------------------------------------------------------------
513 void BrowserDB :: OnFillSqlTyp ()
515 i_SqlTyp
[ 1 ] = SQL_C_BINARY
; s_SqlTyp
[ 1 ] = "SQL_C_BINARY" ;
516 i_SqlTyp
[ 2 ] = SQL_C_BIT
; s_SqlTyp
[ 2 ] = "SQL_C_BIT" ;
517 i_SqlTyp
[ 3 ] = SQL_C_BOOKMARK
; s_SqlTyp
[ 3 ] = "SQL_C_BOOKMARK" ;
518 i_SqlTyp
[ 4 ] = SQL_C_CHAR
; s_SqlTyp
[ 4 ] = "SQL_C_CHAR" ;
519 i_SqlTyp
[ 5 ] = SQL_C_DATE
; s_SqlTyp
[ 5 ] = "SQL_C_DATE" ;
520 i_SqlTyp
[ 6 ] = SQL_C_DEFAULT
; s_SqlTyp
[ 6 ] = "SQL_C_DEFAULT" ;
521 i_SqlTyp
[ 7 ] = SQL_C_DOUBLE
; s_SqlTyp
[ 7 ] = "SQL_C_DOUBLE" ;
522 i_SqlTyp
[ 8 ] = SQL_C_FLOAT
; s_SqlTyp
[ 8 ] = "SQL_C_FLOAT" ;
523 i_SqlTyp
[ 9 ] = SQL_C_LONG
; s_SqlTyp
[ 9 ] = "SQL_C_LONG" ;
524 i_SqlTyp
[ 10 ] = SQL_C_SHORT
; s_SqlTyp
[ 10 ] = "SQL_C_SHORT" ;
525 i_SqlTyp
[ 11 ] = SQL_C_SLONG
; s_SqlTyp
[ 11 ] = "SQL_C_SLONG" ;
526 i_SqlTyp
[ 12 ] = SQL_C_SSHORT
; s_SqlTyp
[ 12 ] = "SQL_C_SSHORT" ;
527 i_SqlTyp
[ 13 ] = SQL_C_STINYINT
; s_SqlTyp
[ 13 ] = "SQL_C_STINYINT" ;
528 i_SqlTyp
[ 14 ] = SQL_C_TIME
; s_SqlTyp
[ 14 ] = "SQL_C_TIME" ;
529 i_SqlTyp
[ 15 ] = SQL_C_TIMESTAMP
; s_SqlTyp
[ 15 ] = "SQL_C_TIMESTAMP" ;
530 i_SqlTyp
[ 16 ] = SQL_C_TINYINT
; s_SqlTyp
[ 16 ] = "SQL_C_TINYINT" ;
531 i_SqlTyp
[ 17 ] = SQL_C_ULONG
; s_SqlTyp
[ 17 ] = "SQL_C_ULONG" ;
532 i_SqlTyp
[ 18 ] = SQL_C_USHORT
; s_SqlTyp
[ 18 ] = "SQL_C_USHORT" ;
533 i_SqlTyp
[ 19 ] = SQL_C_UTINYINT
; s_SqlTyp
[ 19 ] = "SQL_C_UTINYINT" ;
534 i_SqlTyp
[ 20 ] = SQL_VARCHAR
; s_SqlTyp
[ 20 ] = "SQL_VARCHAR" ;
535 i_SqlTyp
[ 21 ] = SQL_NUMERIC
; s_SqlTyp
[ 21 ] = "SQL_NUMERIC" ;
536 i_SqlTyp
[ 22 ] = SQL_LONGVARCHAR
; s_SqlTyp
[ 22 ] = "SQL_LONGVARCHAR" ;
537 i_SqlTyp
[ 23 ] = SQL_REAL
; s_SqlTyp
[ 23 ] = "SQL_REAL" ;
538 i_SqlTyp
[ 0 ] = 23 ; s_SqlTyp
[ 0 ] = "" ;
540 //----------------------------------------------------------------------------------------
541 void BrowserDB :: OnFilldbTyp ()
543 i_dbTyp
[ 1 ] = DB_DATA_TYPE_VARCHAR
; s_dbTyp
[ 1 ] = "DB_DATA_TYPE_VARCHAR" ;
544 i_dbTyp
[ 2 ] = DB_DATA_TYPE_INTEGER
; s_dbTyp
[ 2 ] = "DB_DATA_TYPE_INTEGER" ;
545 i_dbTyp
[ 3 ] = DB_DATA_TYPE_FLOAT
; s_dbTyp
[ 3 ] = "DB_DATA_TYPE_FLOAT" ;
546 i_dbTyp
[ 4 ] = DB_DATA_TYPE_DATE
; s_dbTyp
[ 4 ] = "DB_DATA_TYPE_DATE" ;
547 i_dbTyp
[ 0 ] = 4 ; s_dbTyp
[ 0 ] = "" ;
549 //----------------------------------------------------------------------------------------