DELPHI中DBASE中默认CREATE TABLE类型是VISUAL DBASE7,如何在程序中设置使它生成DBASEIII。 (100分)

  • 主题发起人 主题发起人 Chenchunrui
  • 开始时间 开始时间
C

Chenchunrui

Unregistered / Unconfirmed
GUEST, unregistred user!
DELPHI中DBASE中默认CREATE TABLE类型是VISUAL DBASE7,<br>如何在程序中设置使它生成DBASEIII的TABLE<br>我在程序中是这样写的<br>CREATE TABLE JHCS11<br>&nbsp;(PAGENUM NUMERIC(4,0),<br>&nbsp; ABSTRACT BLOB(1,1),<br>&nbsp; REMARK CHARACTER(100),<br>&nbsp; PUBTYPE CHARACTER(6) );<br>
 
估计应该调用BDE的API了<br>查一下BDE ONLINE REFRENCE
 
我尝试用下面的程序去实现但失败了<br>procedure TfmFgdisk.setdbaseversion;<br>var<br>&nbsp; &nbsp; hCur : hDBICur;<br>&nbsp; &nbsp; Config : CFGDesc;<br>&nbsp; &nbsp; ContinueIt: boolean;<br>begin<br>&nbsp; if DbiInit(nil) = DBIERR_NONE then<br>&nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; hCur := nil;<br>&nbsp; &nbsp; &nbsp; if DbiOpenCfgInfoList(nil, dbiREADWRITE, cfgPersistent,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; '/DRIVERS/DBASE/TABLE CREATE', hCur) = DBIERR_NONE then<br>&nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; &nbsp; if DbiSetToBegin(hCur) = DBIERR_NONE then<br>&nbsp; &nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ContinueIt := true;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while ContinueIt do<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(DbiGetNextRecord(hCur, dbiWRITELOCK, @Config, nil)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;&gt; DBIERR_NONE) then<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ContinueIt := false<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if StrIComp(Config.szNodeName, 'LEVEL') = 0 then<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if StrIComp(Config.szValue, '5') &lt;&gt; 0 then<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; StrCopy(Config.szValue, '5');<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DbiModifyRecord(hCur, @Config, true);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ContinueIt := false<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; &nbsp; DbiExit();<br>&nbsp; &nbsp; end;<br>end;
 
多人接受答案了。
 

Similar threads

后退
顶部