<?xml version="1.0"?>
<OriginStorage Label="" Display="652"><XFname NodeID="11" Label="Name" DataID="300">dbEdit</XFname><xFdescription NodeID="11" Label="Description" DataID="310">New..:Create/Edit/Remove/Load Query</xFdescription><attachTo NodeID="13" Label="Attach to Origin Object" Combo="None|Auto|Column|Sheet/Layer|Book/Graph" DataID="320" Show="0">1</attachTo><author NodeID="11" Label="Author" DataID="314"></author><AutoDependent NodeID="10" Label="Auto Compile Dependent Files" DataID="451">1</AutoDependent><UsageCtxt NodeID="268435456" Label="Usage Context" DataID="329"><LabTalk NodeID="10" Label="Labtalk" DataID="357">1.</LabTalk><WksSel NodeID="10" Label="Worksheet Selection" DataID="350">0.</WksSel><GrObj NodeID="268435456" Label="Graphic Object Events" DataID="330" Use="0"><InitAnchors NodeID="10" Label="Initialization" DataID="339">1.</InitAnchors><Move NodeID="10" Label="Move" DataID="331">1.</Move><Moving NodeID="10" Label="Moving" DataID="332">0.</Moving><Resize NodeID="10" Label="Resize" DataID="333">0.</Resize><Resizing NodeID="10" Label="Resizing" DataID="334">0.</Resizing><Delete NodeID="10" Label="Delete" DataID="335">0.</Delete><Select NodeID="10" Label="Select" DataID="336">0.</Select><Unselect NodeID="10" Label="Unselect" DataID="337">0.</Unselect><BtnClick NodeID="10" Label="Button Click" DataID="338">0.</BtnClick><Rotate NodeID="10" Label="Rotate" DataID="340">0.</Rotate><Rotating NodeID="10" Label="Rotating" DataID="341">0.</Rotating><Skew NodeID="10" Label="Skew" DataID="342">0.</Skew><Skewing NodeID="10" Label="Skewing" DataID="343">0.</Skewing><EditEv NodeID="10" Label="Edit" DataID="344">0.</EditEv><Editing NodeID="10" Label="Editing" DataID="345">0.</Editing><NewSelection NodeID="10" Label="New Selection" DataID="346">0.</NewSelection><DeletePart NodeID="10" Label="Delete Part" DataID="347">0.</DeletePart><Keyboard NodeID="10" Label="Keyboard" DataID="348">0.</Keyboard><ObjType NodeID="13" Label="Type" Combo="Rect|Line" DataID="349">0.</ObjType></GrObj><Theme NodeID="268435456" Label="Theme" DataID="386"><UseInDialog NodeID="10" Label="Support Saving Themes in Dialog" DataID="372">0</UseInDialog><ShowInMenu NodeID="10" Label="Show Themes as Popups in Menu" DataID="352">0</ShowInMenu><SaveInBook NodeID="10" Label="Support Saving to Book" DataID="387">0.</SaveInBook><SaveInSheet NodeID="10" Label="Support Saving to Sheet" DataID="388">0.</SaveInSheet></Theme><mainmenu NodeID="268435456" Label="Menus" DataID="365" Use="0" BranchCombo="None|Main Menus|Context Menus|Both|Context Menus 1|Context Menus 2|Context Menus 3|Context Menus 4"><AddAsTool NodeID="10" Label="Add As Tool" DataID="366">0.</AddAsTool><ClassOp NodeID="10" Label="Class Operation" DataID="367">0.</ClassOp><GetN NodeID="13" Label="Auto GetN Dialog" Combo="None|Simple GetNBox|GetNGraphBox with Preview|GetNImageBox|Wizard|Custom" DataID="371">0</GetN><CustomDialog NodeID="11" Label="Custom Dialog Function" DataID="395" Show="0"></CustomDialog><DlgFromMenu NodeID="10" Label="Open Dialog from Menu for Option Index" DataID="374">1.</DlgFromMenu><checkMenu NodeID="10" Label="Check Menu" DataID="470">0.</checkMenu></mainmenu><windows NodeID="268435456" Label="Windows" DataID="450" Use="1"><graph NodeID="10" Label="Graph" DataID="368">0.</graph><worksheet NodeID="10" Label="Worksheet" DataID="369">1</worksheet><matrix NodeID="10" Label="Matrix" DataID="370">0.</matrix><report NodeID="10" Label="Report" DataID="360">0.</report><none NodeID="10" Label="Layout" DataID="359">0.</none><none NodeID="10" Label="None" DataID="361">0.</none></windows></UsageCtxt><outTree NodeID="10" Label="Generate LabTalk Tree upon execution" DataID="373">1.</outTree><askOutResultsLog NodeID="10" Label="Add Checkbox to Auto GetN Dialog about Results Log Output" DataID="393">0.</askOutResultsLog><outResultsLog NodeID="13" Label="Output to Results Log upon execution" Combo="None|All|Report Tree|First Input|First Output|All Outputs|All Except Trees" DataID="394">0.</outResultsLog><customButtons NodeID="11" Label="GetN Dialog Custom Buttons" DataID="391"></customButtons><syntax NodeID="41" Label="Command Line Usage" DataID="305" MultilineEditExpShrink="1" DispFormat="33554432" RowHeightRange="2-18"><![CDATA[1.dbEdit execute:=change; 
2.dbEdit execute:=load fname:="%Ystars.ods" iw:=[book2]sheet1!; 
3.dbEdit sql:="Select Stars.Name, Stars.LightYears From Stars"; 
]]></syntax><vars NodeID="268435456" Label="Variables" Branch="1"><v1 _XFUNCTION_VAR="1" RepeatID="1"><name NodeID="11" Label="Name" DataID="10">execute</name><description NodeID="11" Label="Label" DataID="20" Show="0">Command Options</description><io NodeID="13" Label="Input/Output" Combo="Input|Output|Input/Output" DataID="30">0</io><type NodeID="11" Label="Data Type" Combo="double|string|int|vector|vector&lt;string&gt;|vector&lt;complex&gt;|Range|XYRange|XYRangeComplex|XYZRange|matrix|ButtonInfo|LineInfo|TextInfo|EventInfo|MarkerInfo|RectInfo|Column|MatrixObject|Image|DataPlot|Page|GraphPage|WorksheetPage|MatrixPage|GraphLayer|Worksheet|MatrixLayer|TreeNode|FileLink|ReportTree|ReportData|GraphPageBase|Layer" DataID="40">int</type><valdata NodeID="13" Label="Data" DataID="50" Combo="" Enable="1">0</valdata><comboString NodeID="11" Label="Control" DataID="70">change:Create/Modify Query|askrem:Remove Query with User Confirmation|load:Load Query File|remove:Remove Query</comboString><context NodeID="268435456" Label="Context" DataID="71"></context><optionString NodeID="11" Label="Option String" DataID="69"></optionString><suggestedValues NodeID="11" Label="Suggested Values" DataID="405"></suggestedValues><themeID NodeID="14" Label="Theme ID" DataID="35">0.</themeID><help NodeID="268435456" Label="English Help" DataID="410" RepeatID="256"><description NodeID="11" Label="Display Name" DataID="408">Command Options</description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8">This command is used to edit SQL, associate a query from file with worksheet or disconnect query with worksheet.</remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3">Command 
options</hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" TypeID="65543" BlobArrElementaryType="8" xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="bin.base64">T3BlbiBxdWVyeSBidWlsZGVyIGRpYWxvZyB0byBjcmVhdGUgb3IgbW9kaWZ5IGEgcXVlcnku
AFJlbW92ZSBxdWVyeSBmcm9tIHdvcmtzaGVldCB3aXRoIHVzZXIgY29uZmlybWF0aW9uLgBM
b2FkIGEgcXVlcnkgb3IgY29ubmVjdGlvbiBhbmQgYXNzb2NpYXRlIHdpdGggdGhlIHdvcmtz
aGVldC4AUmVtb3ZlIHF1ZXJ5IGZyb20gd29ya3NoZWV0IHdpdGhvdXQgY29uZmlybWF0aW9u
LgAA</comboDescription></help><helpj NodeID="268435456" Label="Japanese Help" DataID="410" RepeatID="512"><description NodeID="11" Label="Display Name" DataID="408" CdPg="932">コマンドオプション</description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="932">このコマンドは、SQLを編集したり、ファイルからのクエリとワークシートを結びつけたり、アクティブなワークシートからクエリを切り離すような指定をします。</remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="932">コマンドオプション</hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="932"></comboDescription></helpj><helpg NodeID="268435456" Label="German Help" DataID="410" RepeatID="768"><description NodeID="11" Label="Display Name" DataID="408" CdPg="1252">Befehlsoptionen</description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="1252">Dieser Befehl spezifiziert die Bearbeitung von SQL, die Zuordnung einer Abfrage aus einer Datei zu einem aktiven Worksheet oder die Trennung einer Abfrage vom aktiven Worksheet.</remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="1252">Befehls
optionen</hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="1252"></comboDescription></helpg><helpc NodeID="268435456" Label="Chinese Help" DataID="410" RepeatID="1024"><description NodeID="11" Label="Display Name" DataID="408" CdPg="936"></description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="936"></remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="936"></hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="936"></comboDescription></helpc></v1><v2 _XFUNCTION_VAR="1" RepeatID="2"><name NodeID="11" Label="Name" DataID="10">fname</name><description NodeID="11" Label="Label" DataID="20" Show="0">Input ODQ or ODS file path</description><io NodeID="13" Label="Input/Output" Combo="Input|Output|Input/Output" DataID="30">0.</io><type NodeID="11" Label="Data Type" Combo="double|string|int|vector|vector&lt;string&gt;|vector&lt;complex&gt;|Range|XYRange|XYRangeComplex|XYZRange|matrix|ButtonInfo|LineInfo|TextInfo|EventInfo|MarkerInfo|RectInfo|Column|MatrixObject|Image|DataPlot|Page|GraphPage|WorksheetPage|MatrixPage|GraphLayer|Worksheet|MatrixLayer|TreeNode|FileLink|ReportTree|ReportData|GraphPageBase|Layer" DataID="40">string</type><valdata NodeID="11" Label="Data" DataID="50" Enable="1"><![CDATA[""]]></valdata><comboString NodeID="11" Label="Control" DataID="70"></comboString><context NodeID="268435456" Label="Context" DataID="71"></context><optionString NodeID="11" Label="Option String" DataID="69"></optionString><suggestedValues NodeID="11" Label="Suggested Values" DataID="405"></suggestedValues><themeID NodeID="14" Label="Theme ID" DataID="35">0.</themeID><help NodeID="268435456" Label="English Help" DataID="410" RepeatID="256"><description NodeID="11" Label="Display Name" DataID="408">Input ODQ or ODS file path</description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8">Specify the path of input .odq or .ods file.</remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3"></hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407"></comboDescription></help><helpj NodeID="268435456" Label="Japanese Help" DataID="410" RepeatID="512"><description NodeID="11" Label="Display Name" DataID="408" CdPg="932"></description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="932"></remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="932"></hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="932"></comboDescription></helpj><helpg NodeID="268435456" Label="German Help" DataID="410" RepeatID="768"><description NodeID="11" Label="Display Name" DataID="408" CdPg="1252"></description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="1252"></remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="1252"></hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="1252"></comboDescription></helpg><helpc NodeID="268435456" Label="Chinese Help" DataID="410" RepeatID="1024"><description NodeID="11" Label="Display Name" DataID="408" CdPg="936"></description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="936"></remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="936"></hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="936"></comboDescription></helpc></v2><v3 _XFUNCTION_VAR="1" RepeatID="3"><name NodeID="11" Label="Name" DataID="10">iw</name><description NodeID="11" Label="Label" DataID="20" Show="0">Worksheet</description><io NodeID="13" Label="Input/Output" Combo="Input|Output|Input/Output" DataID="30">0.</io><type NodeID="11" Label="Data Type" Combo="double|string|int|vector|vector&lt;string&gt;|vector&lt;complex&gt;|Range|XYRange|XYRangeComplex|XYZRange|matrix|ButtonInfo|LineInfo|TextInfo|EventInfo|MarkerInfo|RectInfo|Column|MatrixObject|Image|DataPlot|Page|GraphPage|WorksheetPage|MatrixPage|GraphLayer|Worksheet|MatrixLayer|TreeNode|FileLink|ReportTree|ReportData|GraphPageBase|Layer" DataID="40">Worksheet</type><valdata NodeID="81" Label="Data" DataID="50" _DROP_DOWN_BUTTON_ID="2112|1">&lt;active&gt;</valdata><comboString NodeID="11" Label="Control" DataID="70"></comboString><context NodeID="268435456" Label="Context" DataID="71"></context><optionString NodeID="11" Label="Option String" DataID="69"></optionString><suggestedValues NodeID="11" Label="Suggested Values" DataID="405"></suggestedValues><themeID NodeID="14" Label="Theme ID" DataID="35">0.</themeID><help NodeID="268435456" Label="English Help" DataID="410" RepeatID="256"><description NodeID="11" Label="Display Name" DataID="408">Worksheet</description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8">Specify the worksheet which will be associated with.</remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3"></hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407"></comboDescription></help><helpj NodeID="268435456" Label="Japanese Help" DataID="410" RepeatID="512"><description NodeID="11" Label="Display Name" DataID="408" CdPg="932"></description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="932"></remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="932"></hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="932"></comboDescription></helpj><helpg NodeID="268435456" Label="German Help" DataID="410" RepeatID="768"><description NodeID="11" Label="Display Name" DataID="408" CdPg="1252"></description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="1252"></remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="1252"></hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="1252"></comboDescription></helpg><helpc NodeID="268435456" Label="Chinese Help" DataID="410" RepeatID="1024"><description NodeID="11" Label="Display Name" DataID="408" CdPg="936"></description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="936"></remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="936"></hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="936"></comboDescription></helpc></v3><v4 _XFUNCTION_VAR="1" RepeatID="4"><name NodeID="11" Label="Name" DataID="10">sql</name><description NodeID="11" Label="Label" DataID="20" Show="0">New SQL string</description><io NodeID="13" Label="Input/Output" Combo="Input|Output|Input/Output" DataID="30">0.</io><type NodeID="11" Label="Data Type" Combo="double|string|int|vector|vector&lt;string&gt;|vector&lt;complex&gt;|Range|XYRange|XYRangeComplex|XYZRange|matrix|ButtonInfo|LineInfo|TextInfo|EventInfo|MarkerInfo|RectInfo|Column|MatrixObject|Image|DataPlot|Page|GraphPage|WorksheetPage|MatrixPage|GraphLayer|Worksheet|MatrixLayer|TreeNode|FileLink|ReportTree|ReportData|GraphPageBase|Layer" DataID="40">string</type><valdata NodeID="11" Label="Data" DataID="50" Enable="1"><![CDATA[""]]></valdata><comboString NodeID="11" Label="Control" DataID="70"></comboString><context NodeID="268435456" Label="Context" DataID="71"></context><optionString NodeID="11" Label="Option String" DataID="69"></optionString><suggestedValues NodeID="11" Label="Suggested Values" DataID="405"></suggestedValues><themeID NodeID="14" Label="Theme ID" DataID="35">0.</themeID><help NodeID="268435456" Label="English Help" DataID="410" RepeatID="256"><description NodeID="11" Label="Display Name" DataID="408">New SQL string</description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8">Specify a new SQL string.</remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3"></hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407"></comboDescription></help><helpj NodeID="268435456" Label="Japanese Help" DataID="410" RepeatID="512"><description NodeID="11" Label="Display Name" DataID="408" CdPg="932"></description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="932"></remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="932"></hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="932"></comboDescription></helpj><helpg NodeID="268435456" Label="German Help" DataID="410" RepeatID="768"><description NodeID="11" Label="Display Name" DataID="408" CdPg="1252"></description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="1252"></remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="1252"></hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="1252"></comboDescription></helpg><helpc NodeID="268435456" Label="Chinese Help" DataID="410" RepeatID="1024"><description NodeID="11" Label="Display Name" DataID="408" CdPg="936"></description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="936"></remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="936"></hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="936"></comboDescription></helpc></v4><v5 _XFUNCTION_VAR="1" RepeatID="5"><name NodeID="11" Label="Name" DataID="10">connect</name><description NodeID="11" Label="Label" DataID="20" Show="0">New Connection string</description><io NodeID="13" Label="Input/Output" Combo="Input|Output|Input/Output" DataID="30">0.</io><type NodeID="11" Label="Data Type" Combo="double|string|int|vector|vector&lt;string&gt;|vector&lt;complex&gt;|Range|XYRange|XYRangeComplex|XYZRange|matrix|ButtonInfo|LineInfo|TextInfo|EventInfo|MarkerInfo|RectInfo|Column|MatrixObject|Image|DataPlot|Page|GraphPage|WorksheetPage|MatrixPage|GraphLayer|Worksheet|MatrixLayer|TreeNode|FileLink|ReportTree|ReportData|GraphPageBase|Layer" DataID="40">string</type><valdata NodeID="11" Label="Data" DataID="50" Enable="1"><![CDATA[""]]></valdata><comboString NodeID="11" Label="Control" DataID="70"></comboString><context NodeID="268435456" Label="Context" DataID="71"></context><optionString NodeID="11" Label="Option String" DataID="69"></optionString><suggestedValues NodeID="11" Label="Suggested Values" DataID="405"></suggestedValues><themeID NodeID="14" Label="Theme ID" DataID="35">0.</themeID><help NodeID="268435456" Label="English Help" DataID="410" RepeatID="256"><description NodeID="11" Label="Display Name" DataID="408">New Connection string</description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8">Specify a new connection string.</remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3"></hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407"></comboDescription></help><helpj NodeID="268435456" Label="Japanese Help" DataID="410" RepeatID="512"><description NodeID="11" Label="Display Name" DataID="408" CdPg="932"></description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="932"></remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="932"></hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="932"></comboDescription></helpj><helpg NodeID="268435456" Label="German Help" DataID="410" RepeatID="768"><description NodeID="11" Label="Display Name" DataID="408" CdPg="1252"></description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="1252"></remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="1252"></hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="1252"></comboDescription></helpg><helpc NodeID="268435456" Label="Chinese Help" DataID="410" RepeatID="1024"><description NodeID="11" Label="Display Name" DataID="408" CdPg="936"></description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="936"></remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="936"></hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="936"></comboDescription></helpc></v5><v6 _XFUNCTION_VAR="1" RepeatID="6"><name NodeID="11" Label="Name" DataID="10">option</name><description NodeID="11" Label="Label" DataID="20" Show="0">Import Option</description><io NodeID="13" Label="Input/Output" Combo="Input|Output|Input/Output" DataID="30">0.</io><type NodeID="11" Label="Data Type" Combo="double|string|int|vector|vector&lt;string&gt;|vector&lt;complex&gt;|Range|XYRange|XYRangeComplex|XYZRange|matrix|ButtonInfo|LineInfo|TextInfo|EventInfo|MarkerInfo|RectInfo|Column|MatrixObject|Image|DataPlot|Page|GraphPage|WorksheetPage|MatrixPage|GraphLayer|Worksheet|MatrixLayer|TreeNode|FileLink|ReportTree|ReportData|GraphPageBase|Layer" DataID="40">int</type><valdata NodeID="13" Label="Data" DataID="50" Combo="" Enable="1">0</valdata><comboString NodeID="11" Label="Control" DataID="70">ado:Use ADO Object to Import Data|odbc:Use ODBC to Import Data</comboString><context NodeID="268435456" Label="Context" DataID="71"></context><optionString NodeID="11" Label="Option String" DataID="69"></optionString><suggestedValues NodeID="11" Label="Suggested Values" DataID="405"></suggestedValues><themeID NodeID="14" Label="Theme ID" DataID="35">0.</themeID><help NodeID="268435456" Label="English Help" DataID="410" RepeatID="256"><description NodeID="11" Label="Display Name" DataID="408">Import Option</description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8">Specify how to import data.</remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3"></hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" TypeID="65543" BlobArrElementaryType="8" xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="bin.base64">VXNlIEFETyBvYmplY3QgdG8gaW1wb3J0IGRhdGEuIFRoaXMgb3B0aW9uIGlzIHVzZWQgYnkg
ZGVmYXVsdC4AVXNlIE9EQkMgdG8gaW1wb3J0IGRhdGEuAAA=</comboDescription></help><helpj NodeID="268435456" Label="Japanese Help" DataID="410" RepeatID="512"><description NodeID="11" Label="Display Name" DataID="408" CdPg="932"></description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="932"></remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="932"></hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="932"></comboDescription></helpj><helpg NodeID="268435456" Label="German Help" DataID="410" RepeatID="768"><description NodeID="11" Label="Display Name" DataID="408" CdPg="1252"></description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="1252"></remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="1252"></hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="1252"></comboDescription></helpg><helpc NodeID="268435456" Label="Chinese Help" DataID="410" RepeatID="1024"><description NodeID="11" Label="Display Name" DataID="408" CdPg="936"></description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="936"></remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="936"></hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="936"></comboDescription></helpc></v6></vars><modificationLog NodeID="41" Label="Modification Log" DataID="438" MultilineEditExpShrink="1" DispFormat="33554432" RowHeightRange="2-15">12/18/2006 Erica Shang Edit
Larry, 12/21/06. Modify. Basically done.
8/22/07. Larry. Review document.

CPY 1/21/2008 QA70-10972 LT_CONTROL_OF_DB_ACCESS
Penn 11/10/09 update document, command line usage, description.</modificationLog><codes NodeID="268435456" Label="Code" DataID="324"><rettype NodeID="11" Label="Return Type" Combo="void|int|double|string|vector" DataID="41">void</rettype><header NodeID="45" Label="Header" DataID="323" MultilineEditExpShrink="1" DispFormat="33554432" RowHeightRange="3-15"><![CDATA[

//--------- Modification Log -----------------
// CPY 1/21/2008 QA70-10972 LT_CONTROL_OF_DB_ACCESS
//  I reorder the enum above, used to be edit/remove/load so ogs will have dbEdit 2, but I see dbEdit 2 should open dialog, default should be to load to active wks
// CPY 1/21/2008 QA70-10972-P3 QUERY_BUILDER_SHOULD_BE_MODAL
/// AW 05/07/08 AW QA80-11454 DO_NOTHING_IF_SELECT_CANCE_IN_ADD_QUERY_FILE
///Sophy 8/3/2009 QA80-14057 SUPPORT_IMPORTING_INTO_WKS_USING_ODBC_IN_QUERY_BUILDER
///-----Kit 10/20/2010 ORG-1293-P1 ADD_SYSVAR_FOR_DATABASE_IMPORT_TOOL

typedef int (*FUNC_INT_WKSREF)(Worksheet& wks); //CPY 1/21/2008 QA70-10972-P3 QUERY_BUILDER_SHOULD_BE_MODAL

#include <..\originlab\datasource.h>
//#include <..\originlab\FileList.h>
//#include <..\originlab\QueryBldrDlg.h>

//put your own support static functions here
//enum {DBE_EDIT, DBE_REMOVE, DBE_LOAD};
/*
enum {
	ERR_FAIL_TO_LOAD   = XF_LOCAL_ERR_BEGIN,
	ERR_FAIL_TO_LOAD_TO_WKS,
	ERR_NO_ACTIVE_WKS,
};
*/

//----- CPY 1/21/2008 QA70-10972 LT_CONTROL_OF_DB_ACCESS
// SQL must have at least "select", ds must also be quite long, not sure, just 2 for now
#define MIN_SQL_LENGTH 7
#define MIN_DS_LENGTH 2
static bool _is_ODS_file(const string& strFile, string& strNameExt)
{
	string strTemp, strExt;
	separate_file_name_ext(strFile, &strTemp, &strExt);
	strNameExt = GetFileName(strFile);
	
	strExt.MakeLower();
	if(strExt == "ods")
		return true;
	
	return false;
}
//-----
]]></header><code NodeID="45" Label="Expression" DataID="325" MultilineEditExpShrink="1" DispFormat="33554432" RowHeightRange="5-20"><![CDATA[//----- CPY 1/21/2008 QA70-10972 LT_CONTROL_OF_DB_ACCESS
//Worksheet wks=Project.ActiveLayer();
string strDSFile, strDS, strSQL, strODQfile;
Worksheet wks;
if(iw)
	wks = iw;
else
	wks = Project.ActiveLayer();
int cmd = execute;
//-----

/// AW 06/05/2006 MORE_ON_LOAD_ODQ
// we need a tag to know if QueryBldrDlg called from LOAD ODQ or others, here, we just simplely use nonZero for it, so need another head file for it.
//---- CPY 1/21/2008 QA70-10972-P3 QUERY_BUILDER_SHOULD_BE_MODAL
//DWORD dwCntrl = 0;
//----
/// END MORE_ON_LOAD_ODQ
if(execute_load == cmd)
{
	LPCSTR lpcszODQfile = NULL;//----- CPY 1/21/2008 QA70-10972 LT_CONTROL_OF_DB_ACCESS
	if(wks)
	{
		//----- CPY 1/21/2008 QA70-10972 LT_CONTROL_OF_DB_ACCESS
		//if ( !db_load_query(strDS, strSQL, NULL, &strDSFile, &strODQfile) )
		if(fname.GetLength() > 1)
		{
			string strDSFileName;
			bool bIsODS = _is_ODS_file(fname, strDSFileName);
			bool bIsFileValid = fname.IsFile();
			if(bIsFileValid && !bIsODS)
				lpcszODQfile = fname;
			else
			{
				if(bIsODS) // must be bIsFileValid
				{
					if(!db_load_data_source(fname, strDS, &strDSFile))
						XF_THROW_EX(XFERR_FAIL_TO_LOAD_ODS, fname);
					if(strDSFile.IsEmpty())
						strDSFile = strDSFileName;
					if(strSQL.IsEmpty())
						strSQL = " "; // empty will remove it
					if(!db_wks_set_query(wks, strDS, strSQL, strDSFile))
						XF_THROW(XFERR_FAIL_TO_LOAD_DATABASE_TO_WKS);

					return;
				}
				XF_THROW_EX(XF_CD_NOT_VALID_PATH, fname);
			}
		}
		///Sophy 8/3/2009 QA80-14057 SUPPORT_IMPORTING_INTO_WKS_USING_ODBC_IN_QUERY_BUILDER
#ifndef	__SUPPORT_IMPORT_DATA_BY_ODBC_IN_QUERY_BUILDER__
		if ( !db_load_query(strDS, strSQL, lpcszODQfile, &strDSFile, &strODQfile) )
		//----
		{
			XF_THROW_EX(XFERR_FAIL_TO_LOAD_DATABASE, fname);
		}
#else
		string	strQueryMode = "";
		if ( !db_load_query(strDS, strSQL, lpcszODQfile, &strDSFile, &strODQfile, &strQueryMode) )
		//----
		{
			XF_THROW_EX(XFERR_FAIL_TO_LOAD_DATABASE, fname);
		}
		
		BOOL	bUseODBC = strQueryMode.CompareNoCase(STR_QUERY_MODE_ADO) == 0 ? FALSE : TRUE;
		
#endif	//__SUPPORT_IMPORT_DATA_BY_ODBC_IN_QUERY_BUILDER__
		//----- CPY 1/21/2008 QA70-10972 LT_CONTROL_OF_DB_ACCESS
		///// AW 09/15/07 QA80-9625 MORE_ON_CANCEL_LOAD_ODQ 
		//if( strODQfile.IsEmpty() )
		//	XF_THROW(CER_NO_ERROR);	
		///// END MORE_ON_CANCEL_LOAD_ODQ
		//-----
		/// AW 05/07/08 AW QA80-11454 DO_NOTHING_IF_SELECT_CANCE_IN_ADD_QUERY_FILE
		if( strODQfile.IsEmpty() )
			return;
		/// END DO_NOTHING_IF_SELECT_CANCE_IN_ADD_QUERY_FILE
		
		///Sophy 8/3/2009 QA80-14057 SUPPORT_IMPORTING_INTO_WKS_USING_ODBC_IN_QUERY_BUILDER
#ifndef	__SUPPORT_IMPORT_DATA_BY_ODBC_IN_QUERY_BUILDER__
		if(!db_wks_set_query(wks, strDS, strSQL, strDSFile))
			XF_THROW(XFERR_FAIL_TO_LOAD_DATABASE_TO_WKS);
#else
		if(!db_wks_set_query(wks, strDS, strSQL, strDSFile, false, &bUseODBC))
			XF_THROW(XFERR_FAIL_TO_LOAD_DATABASE_TO_WKS);
#endif	//__SUPPORT_IMPORT_DATA_BY_ODBC_IN_QUERY_BUILDER__
	}
	else
		XF_THROW(XFERR_NO_ACTIVE_WORKSHEET);
	
	//----- CPY 1/21/2008 QA70-10972 LT_CONTROL_OF_DB_ACCESS
	//dwCntrl = 1;			/// AW 06/05/2006 MORE_ON_LOAD_ODQ
	return;
	//-----
}
//----- CPY 1/21/2008 QA70-10972 LT_CONTROL_OF_DB_ACCESS
//if(execute_remove == cmd)
else if(execute_askrem == cmd || execute_remove == cmd)
//-----
{
	if(wks)
	{
		//----- CPY 1/21/2008 QA70-10972 LT_CONTROL_OF_DB_ACCESS
		//if(IDOK == MessageBox(GetWindow(), _L("Are you sure you want to remove the SQL object in the active worksheet?"), _L("SQL in Worksheet"), MB_OKCANCEL|MB_ICONQUESTION)) 		
		if(execute_remove == cmd ||
			IDOK == MessageBox(GetWindow(), 
			_L("Are you sure you want to remove the SQL object in the active worksheet?"), 
			_L("SQL in Worksheet"), MB_OKCANCEL|MB_ICONQUESTION))
		//-----
			db_wks_set_query(wks);
	}
	else
		XF_THROW(XFERR_NO_ACTIVE_WORKSHEET);
	return;
}
//----- CPY 1/21/2008 QA70-10972 LT_CONTROL_OF_DB_ACCESS
else if(execute_change == cmd && (sql.GetLength() > MIN_SQL_LENGTH || connect.GetLength() > MIN_DS_LENGTH))
{
	if(!wks)
		XF_THROW(XFERR_NO_ACTIVE_WORKSHEET);
	
	db_wks_get_query(wks, strDS, strSQL, strDSFile);
	
	if(sql.GetLength() > MIN_SQL_LENGTH)
		strSQL = sql;
	if(connect.GetLength() > MIN_DS_LENGTH)
		strDS = connect;
	///Sophy 8/3/2009 QA80-14057 SUPPORT_IMPORTING_INTO_WKS_USING_ODBC_IN_QUERY_BUILDER
#ifndef	__SUPPORT_IMPORT_DATA_BY_ODBC_IN_QUERY_BUILDER__
	if(!db_wks_set_query(wks, strDS, strSQL, strDSFile, false))
#else
	BOOL bUseODBC = option_odbc == option ? TRUE : FALSE;
	if( !db_wks_set_query(wks, strDS, strSQL, strDSFile, false, &bUseODBC) )
#endif	//__SUPPORT_IMPORT_DATA_BY_ODBC_IN_QUERY_BUILDER__
		XF_THROW(XFERR_FAIL_TO_LOAD_DATABASE_TO_WKS);
		
	return;
}
//-----

string strFunc = "QueryBldrDlg";
//------------------ CPY 1/21/2008 QA70-10972-P3 QUERY_BUILDER_SHOULD_BE_MODAL
//FUNC_INT_DWORD pfn = Project.FindFunction(strFunc, "OriginLab\\QueryBldrDlg", true);
/// AW 06/05/2006 MORE_ON_LOAD_ODQ
//if(pfn)
//	pfn(0,0);	
//if(pfn)
//	pfn(0,dwCntrl);	 
/// END MORE_ON_LOAD_ODQ

///-----Kit 10/20/2010 ORG-1293-P1 ADD_SYSVAR_FOR_DATABASE_IMPORT_TOOL
#ifndef	__NEW_DATABASEIMPORTDLG__
FUNC_INT_WKSREF pfn = Project.FindFunction(strFunc, "OriginLab\\QueryBldrDlg", true);
#else
double dVal;
LT_get_var("@did", &dVal); 
int nVal = (dVal == 0.0) ? 1 : 0;
string strTitleText = _L("Attention\r\nOrigin provides two different database import dialogs. Please select one of them.\r\nNote: To manually change the default database import dialog, please refer to the @DID system variable.\r\n\r\nWhat kind of dialog do you like:");
vector<string> vsChoices(2);
vsChoices[0] = _L("SQL Editor to type SQL statement directly");
vsChoices[1] = _L("Graphical Query Builder to create SQL statement");
string strCheckBox = _L("Do not show this message in the future");

int nChoice = RatioReminderMessage("ADODlgReminder", strTitleText, &vsChoices, nVal, strCheckBox);
if ( nChoice == -1 ) //when cancel, should use default value
	nChoice = nVal;
LT_set_var("@did", (nChoice == 0 ? 1 : 0));

FUNC_INT_WKSREF pfn;
if( 1 == nChoice )
	pfn = Project.FindFunction( strFunc, "OriginLab\\QueryBldrDlg", true );
else
	pfn = Project.FindFunction( "OpenDatabaseImportDlg", "OriginLab\\DatabaseImportDlg", true );
#endif	//__NEW_DATABASEIMPORTDLG__
///-----End ADD_SYSVAR_FOR_DATABASE_IMPORT_TOOL
if(pfn)
	pfn(wks);
//-------------------
]]></code><event1 NodeID="45" Label="Event1" DataID="327" MultilineEditExpShrink="1" DispFormat="33554432" RowHeightRange="5-20" Show="0"><![CDATA[return false;]]></event1><event2 NodeID="45" Label="Event2" DataID="376" MultilineEditExpShrink="1" DispFormat="33554432" RowHeightRange="5-20" Show="0"><![CDATA[return false;]]></event2><event3 NodeID="45" Label="Event3" DataID="378" MultilineEditExpShrink="1" DispFormat="33554432" RowHeightRange="5-20" Show="0"><![CDATA[]]></event3><event4 NodeID="45" Label="Event4" DataID="377" MultilineEditExpShrink="1" DispFormat="33554432" RowHeightRange="5-20" Show="0"><![CDATA[NodeVariant]]></event4><GetNEvent NodeID="47" Label="GetNBox Event" DataID="379" Show="0"></GetNEvent></codes><SaveInOpj NodeID="10" Label="Save with Object" DataID="560">0.</SaveInOpj><optargindex NodeID="14" Label="Option Argument Index" DataID="72">0.</optargindex><version NodeID="14" Label="Version" DataID="73">1.</version><category NodeID="11" Label="Primary Category" DataID="74" Show="0">Database Access</category><subcategory NodeID="11" Label="Primary Subcategory" DataID="77" Show="0"></subcategory><seccategory1 NodeID="11" Label="Secondary Category" DataID="75" Show="0"></seccategory1><secsubcategory1 NodeID="11" Label="Secondary Subcategory 1" DataID="78" Show="0"></secsubcategory1><seccategory2 NodeID="11" Label="Secondary Category 2" DataID="76" Show="0"></seccategory2><secsubcategory2 NodeID="11" Label="Secondary Subcategory 2" DataID="79" Show="0"></secsubcategory2><module NodeID="11" Label="Module" DataID="80"></module><subGroup NodeID="17" Label="Subgroup Index Within a Category" Combo="-10|-9|-8|-7|-6|-5|-4|-3|-2|-1|0|1|2|3|4|5|6|7|8|9" DataID="82">-3</subGroup><errmsgCount NodeID="14" Label="Number of Error Messages" DataID="412">3</errmsgCount><helpe NodeID="268435456" Label="English Help" DataID="420" RepeatID="256"><info NodeID="41" Label="Auto Complete Hint" DataID="422" RowHeightRange="2-8"></info><summary NodeID="47" Label="Summary" DataID="421" Show="0"><![CDATA[]]></summary><example NodeID="47" Label="Examples" DataID="431" Show="0"><![CDATA[]]></example><ref NodeID="47" Label="References" DataID="432" Show="0"><![CDATA[]]></ref><algorithm NodeID="47" Label="Algorithm" DataID="434" Show="0"><![CDATA[]]></algorithm><parameters NodeID="47" Label="Parameters" DataID="444" Show="0"><![CDATA[]]></parameters><script NodeID="41" Label="LabTalk Script Example" Show="0" DataID="436" RowHeightRange="2-12"></script><errmsgs NodeID="47" Label="Error Messages" DataID="413" Show="0" TypeID="65543" BlobArrElementaryType="8" xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="bin.base64">RmFpbGVkIHRvIGxvYWQgZGF0YSBmb3JtIGRhdGFiYXNlIQBGYWlsZWQgdG8gbG9hZCBkYXRh
IGZvcm0gZGF0YWJhc2UgdG8gd29ya3NoZWV0IQBObyBhY3RpdmUgd29ya3NoZWV0IQAA</errmsgs></helpe><helpj NodeID="268435456" Label="Japanese Help" DataID="420" RepeatID="512"><description NodeID="11" Label="Description" DataID="440" CdPg="932">クエリの作成/編集/削除/読込み</description><customButtons NodeID="11" Label="GetN Dialog Custom Buttons" DataID="448" CdPg="932"></customButtons><info NodeID="41" Label="Auto Complete Hint" DataID="422" RowHeightRange="2-8" CdPg="932"></info><summary NodeID="47" Label="Summary" DataID="421" Show="0" CdPg="932"><![CDATA[]]></summary><example NodeID="47" Label="Examples" DataID="431" Show="0" CdPg="932"><![CDATA[]]></example><ref NodeID="47" Label="References" DataID="432" Show="0" CdPg="932"><![CDATA[]]></ref><algorithm NodeID="47" Label="Algorithm" DataID="434" Show="0" CdPg="932"><![CDATA[]]></algorithm><parameters NodeID="47" Label="Parameters" DataID="444" Show="0" CdPg="932"><![CDATA[]]></parameters><script NodeID="41" Label="LabTalk Script Example" Show="0" DataID="436" RowHeightRange="2-12" CdPg="932"></script><errmsgs NodeID="47" Label="Error Messages" DataID="413" Show="0" CdPg="932"></errmsgs></helpj><helpg NodeID="268435456" Label="German Help" DataID="420" RepeatID="768"><description NodeID="11" Label="Description" DataID="440" CdPg="1252">:Erstellen/Bearbeiten/Entfernen/Abfrage laden</description><customButtons NodeID="11" Label="GetN Dialog Custom Buttons" DataID="448" CdPg="1252"></customButtons><info NodeID="41" Label="Auto Complete Hint" DataID="422" RowHeightRange="2-8" CdPg="1252"></info><summary NodeID="47" Label="Summary" DataID="421" Show="0" CdPg="1252"><![CDATA[]]></summary><example NodeID="47" Label="Examples" DataID="431" Show="0" CdPg="1252"><![CDATA[]]></example><ref NodeID="47" Label="References" DataID="432" Show="0" CdPg="1252"><![CDATA[]]></ref><algorithm NodeID="47" Label="Algorithm" DataID="434" Show="0" CdPg="1252"><![CDATA[]]></algorithm><parameters NodeID="47" Label="Parameters" DataID="444" Show="0" CdPg="1252"><![CDATA[]]></parameters><script NodeID="41" Label="LabTalk Script Example" Show="0" DataID="436" RowHeightRange="2-12" CdPg="1252"></script><errmsgs NodeID="47" Label="Error Messages" DataID="413" Show="0" CdPg="1252"></errmsgs></helpg><helpc NodeID="268435456" Label="Chinese Help" DataID="420" RepeatID="1024"><description NodeID="11" Label="Description" DataID="440" CdPg="936"></description><customButtons NodeID="11" Label="GetN Dialog Custom Buttons" DataID="448" CdPg="936"></customButtons><info NodeID="41" Label="Auto Complete Hint" DataID="422" RowHeightRange="2-8" CdPg="936"></info><summary NodeID="47" Label="Summary" DataID="421" Show="0" CdPg="936"><![CDATA[]]></summary><example NodeID="47" Label="Examples" DataID="431" Show="0" CdPg="936"><![CDATA[]]></example><ref NodeID="47" Label="References" DataID="432" Show="0" CdPg="936"><![CDATA[]]></ref><algorithm NodeID="47" Label="Algorithm" DataID="434" Show="0" CdPg="936"><![CDATA[]]></algorithm><parameters NodeID="47" Label="Parameters" DataID="444" Show="0" CdPg="936"><![CDATA[]]></parameters><script NodeID="41" Label="LabTalk Script Example" Show="0" DataID="436" RowHeightRange="2-12" CdPg="936"></script><errmsgs NodeID="47" Label="Error Messages" DataID="413" Show="0" CdPg="936"></errmsgs></helpc><SkipHiddenInDlg NodeID="10" Label="Skip hidden in dialog" DataID="295">0.</SkipHiddenInDlg><ClearMsg NodeID="10" Label="Auto Clear Error Message in dialog" DataID="296">1.</ClearMsg><KeepBtnStatus NodeID="10" Label="Keep Button Status for Event Handler" DataID="298">0.</KeepBtnStatus><SptApplyUndoButtonSts NodeID="10" Label="Control Apply and Undo button by User" DataID="294">0.</SptApplyUndoButtonSts><PreviewButton NodeID="10" Label="Show Preview Button" DataID="299">0.</PreviewButton><AutoApplyChkbox NodeID="10" Label="Show Auto Apply CheckBox" DataID="290">1.</AutoApplyChkbox><SkipHelpDoc NodeID="10" Label="Skip Help Document Processing" DataID="297">0.</SkipHelpDoc><SupportFolderLastUsed NodeID="10" Label="Support Folder Last Used Theme" DataID="291">0.</SupportFolderLastUsed><NotCloseOnEnterKey NodeID="10" Label="Do not Close Dialog upon Enter Key" DataID="292">0.</NotCloseOnEnterKey><seeAlso NodeID="11" Label="See Also" DataID="430"><![CDATA[dbimport, dbinfo, dbpreview ]]></seeAlso><relatedXF NodeID="11" Label="Related X-Functions" DataID="442"></relatedXF></OriginStorage>
