home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1997 May / VPR9705A.ISO / VPR_DATA / PROGRAM / CBTRIAL / SETUP / DATA.Z / UPDSQLED.HPP < prev    next >
C/C++ Source or Header  |  1997-02-14  |  6KB  |  161 lines

  1. //----------------------------------------------------------------------------
  2. // UpdSqlEd.hpp - bcbdcc32 generated hdr (DO NOT EDIT) rev: 0
  3. // From: UpdSqlEd.pas
  4. //----------------------------------------------------------------------------
  5. #ifndef UpdSqlEdHPP
  6. #define UpdSqlEdHPP
  7. //----------------------------------------------------------------------------
  8. #include <Menus.hpp>
  9. #include <Windows.hpp>
  10. #include <SysUtils.hpp>
  11. #include <Classes.hpp>
  12. #include <ComCtrls.hpp>
  13. #include <Controls.hpp>
  14. #include <StdCtrls.hpp>
  15. #include <ExtCtrls.hpp>
  16. #include <DBTables.hpp>
  17. #include <DB.hpp>
  18. #include <Forms.hpp>
  19. #include <System.hpp>
  20. #pragma warn -par
  21. #pragma warn -hid 
  22. #pragma warn -inl
  23.  
  24. namespace Updsqled
  25. {
  26. //-- type declarations -------------------------------------------------------
  27. typedef void __fastcall (__closure *TWaitMethod)(void);
  28.  
  29. class __declspec(delphiclass) TUpdateSQLEditForm;
  30. class __declspec(pascalimplementation) TUpdateSQLEditForm : public Forms::TForm
  31. {
  32.     typedef Forms::TForm inherited;
  33.     
  34. __published:
  35.     Stdctrls::TButton* OkButton;
  36.     Stdctrls::TButton* CancelButton;
  37.     Stdctrls::TButton* HelpButton;
  38.     Stdctrls::TButton* GenerateButton;
  39.     Stdctrls::TButton* PrimaryKeyButton;
  40.     Stdctrls::TButton* DefaultButton;
  41.     Stdctrls::TComboBox* UpdateTableName;
  42.     Comctrls::TTabSheet* FieldsPage;
  43.     Comctrls::TTabSheet* SQLPage;
  44.     Comctrls::TPageControl* PageControl;
  45.     Stdctrls::TListBox* KeyFieldList;
  46.     Stdctrls::TListBox* UpdateFieldList;
  47.     Stdctrls::TGroupBox* GroupBox1;
  48.     Stdctrls::TLabel* Label1;
  49.     Stdctrls::TMemo* SQLMemo;
  50.     Dbtables::TTable* TempTable;
  51.     Extctrls::TRadioGroup* StatementType;
  52.     Stdctrls::TCheckBox* QuoteFields;
  53.     Stdctrls::TButton* GetTableFieldsButton;
  54.     Menus::TPopupMenu* FieldListPopup;
  55.     Menus::TMenuItem* miSelectAll;
  56.     Menus::TMenuItem* miClearAll;
  57.     void __fastcall FormCreate(System::TObject* Sender);
  58.     void __fastcall HelpButtonClick(System::TObject* Sender);
  59.     void __fastcall StatementTypeClick(System::TObject* Sender);
  60.     void __fastcall OkButtonClick(System::TObject* Sender);
  61.     void __fastcall DefaultButtonClick(System::TObject* Sender);
  62.     void __fastcall GenerateButtonClick(System::TObject* Sender);
  63.     void __fastcall PrimaryKeyButtonClick(System::TObject* Sender);
  64.     void __fastcall PageControlChanging(System::TObject* Sender, bool &AllowChange);
  65.     void __fastcall FormDestroy(System::TObject* Sender);
  66.     void __fastcall GetTableFieldsButtonClick(System::TObject* Sender);
  67.     void __fastcall SettingsChanged(System::TObject* Sender);
  68.     void __fastcall FormCloseQuery(System::TObject* Sender, bool &CanClose);
  69.     void __fastcall UpdateTableNameChange(System::TObject* Sender);
  70.     void __fastcall UpdateTableNameClick(System::TObject* Sender);
  71.     void __fastcall SelectAllClick(System::TObject* Sender);
  72.     void __fastcall ClearAllClick(System::TObject* Sender);
  73.     void __fastcall SQLMemoKeyPress(System::TObject* Sender, char &Key);
  74.     
  75. private:
  76.     int StmtIndex;
  77.     Db::TDBDataSet* DataSet;
  78.     Db::TDatabase* Database;
  79.     bool DatabaseOpened;
  80.     Dbtables::TUpdateSQL* UpdateSQL;
  81.     bool FSettingsChanged;
  82.     bool FDatasetDefaults;
  83.     Classes::TStrings* SQLText[3];
  84.     void __fastcall CheckFieldTypes(Classes::TStrings* UpdateFieldList);
  85.     System::AnsiString __fastcall GetTableRef(const System::AnsiString TabName, const System::AnsiString 
  86.         QuoteChar);
  87.     bool __fastcall DatabaseOpen(void);
  88.     bool __fastcall Edit(void);
  89.     void __fastcall GenWhereClause(const System::AnsiString TabAlias, const System::AnsiString QuoteChar
  90.         , Classes::TStrings* KeyFields, Classes::TStrings* SQL);
  91.     void __fastcall GenDeleteSQL(const System::AnsiString TableName, const System::AnsiString QuoteChar
  92.         , Classes::TStrings* KeyFields, Classes::TStrings* SQL);
  93.     void __fastcall GenInsertSQL(const System::AnsiString TableName, const System::AnsiString QuoteChar
  94.         , Classes::TStrings* UpdateFields, Classes::TStrings* SQL);
  95.     void __fastcall GenModifySQL(const System::AnsiString TableName, const System::AnsiString QuoteChar
  96.         , Classes::TStrings* KeyFields, Classes::TStrings* UpdateFields, Classes::TStrings* SQL);
  97.     void __fastcall GenerateSQL(void);
  98.     void __fastcall GetDataSetFieldNames(void);
  99.     void __fastcall GetTableFieldNames(void);
  100.     void __fastcall InitGenerateOptions(void);
  101.     void __fastcall InitUpdateTableNames(void);
  102.     void __fastcall SetButtonStates(void);
  103.     void __fastcall SelectPrimaryKeyFields(void);
  104.     void __fastcall SetDefaultSelections(void);
  105.     void __fastcall ShowWait(TWaitMethod WaitMethod);
  106. public:
  107.     /* TForm.Create */ __fastcall virtual TUpdateSQLEditForm(Classes::TComponent* AOwner) : Forms::TForm(
  108.         AOwner) { }
  109.     /* TForm.CreateNew */ __fastcall TUpdateSQLEditForm(Classes::TComponent* AOwner, int Dummy) : Forms::
  110.         TForm(AOwner, Dummy) { }
  111.     /* TForm.Destroy */ __fastcall virtual ~TUpdateSQLEditForm(void) { }
  112.     
  113. public:
  114.     /* TWinControl.CreateParented */ __fastcall TUpdateSQLEditForm(HWND ParentWindow) : Forms::TForm(ParentWindow
  115.         ) { }
  116.     
  117. };
  118.  
  119. enum TSQLToken { stSymbol, stAlias, stNumber, stComma, stEQ, stOther, stLParen, stRParen, stEnd };
  120.  
  121. class __declspec(delphiclass) TSQLParser;
  122. class __declspec(pascalimplementation) TSQLParser : public System::TObject
  123. {
  124.     typedef System::TObject inherited;
  125.     
  126. private:
  127.     System::AnsiString FText;
  128.     char *FSourcePtr;
  129.     char *FTokenPtr;
  130.     System::AnsiString FTokenString;
  131.     TSQLToken FToken;
  132.     TSQLToken __fastcall NextToken(void);
  133.     bool __fastcall TokenSymbolIs(const System::AnsiString S);
  134.     void __fastcall Reset(void);
  135.     
  136. public:
  137.     __fastcall TSQLParser(const System::AnsiString Text);
  138.     void __fastcall GetSelectTableNames(Classes::TStrings* List);
  139.     void __fastcall GetUpdateTableName( System::AnsiString &TableName);
  140.     void __fastcall GetUpdateFields(Classes::TStrings* List);
  141.     void __fastcall GetWhereFields(Classes::TStrings* List);
  142. public:
  143.     /* TObject.Destroy */ __fastcall virtual ~TSQLParser(void) { }
  144.     
  145. };
  146.  
  147. //-- var, const, procedure ---------------------------------------------------
  148. extern bool __fastcall EditUpdateSQL(Dbtables::TUpdateSQL* AUpdateSQL);
  149.  
  150. }    /* namespace Updsqled */
  151.  
  152. #pragma warn .par
  153. #pragma warn .hid 
  154. #pragma warn .inl
  155.  
  156. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  157. using namespace Updsqled;
  158. #endif
  159. //-- end unit ----------------------------------------------------------------
  160. #endif    // UpdSqlEd
  161.