Delphi7运行一个程序,老是跳出如下错误,'access violation at 0x4be43541 : read of address 0x00000

  • 主题发起人 主题发起人 xhzhengzheng
  • 开始时间 开始时间
X

xhzhengzheng

Unregistered / Unconfirmed
GUEST, unregistred user!
Delphi7运行一个程序,老是跳出如下错误,'access violation at 0x4be43541 : read of address 0x0000000026'. Process Stopped . Use Step or Run to continue.(100分)<br />我在Delphi7运行一个程序,老是跳出如下错误,<br>Debugger Fault Notification<br>'access violation at 0x4be43541 : read of address 0x0000000026'. Process Stopped . Use Step or Run to continue.<br><br>然后就是显示CPU运行界面,但是这个程序可以Compile和 Build &nbsp;,就是不能Debug ,数据库联接是Dephi7中的BDE,差不过在运行到联接ORACLE8i数据库时就提示上面的内容,我不知道应该怎样处理好?<br>部分原代码,帮忙看看有没有错.<br>(以下为从A数据库ORACEL某一表中读取数据据,向B SYBASE数据库中的某表中导入数据,中间有转换数据库,是作为AB两数据库的临时存储)<br>object Form1: TForm1<br> &nbsp;Left = 113<br> &nbsp;Top = 73<br> &nbsp;BorderStyle = bsDialog<br> &nbsp;Caption = '转换程序'<br> &nbsp;ClientHeight = 573<br> &nbsp;ClientWidth = 792<br> &nbsp;Color = clBtnFace<br> &nbsp;Font.Charset = GB2312_CHARSET<br> &nbsp;Font.Color = clBlack<br> &nbsp;Font.Height = -15<br> &nbsp;Font.Name = '宋体'<br> &nbsp;Font.Style = []<br> &nbsp;OldCreateOrder = False<br> &nbsp;OnCreate = FormCreate<br> &nbsp;PixelsPerInch = 96<br> &nbsp;TextHeight = 15<br> &nbsp;object Label1: TLabel<br> &nbsp; &nbsp;Left = 16<br> &nbsp; &nbsp;Top = 544<br> &nbsp; &nbsp;Width = 181<br> &nbsp; &nbsp;Height = 15<br> &nbsp; &nbsp;Caption = '可选单数:0;已选单数:0'<br> &nbsp; &nbsp;Font.Charset = GB2312_CHARSET<br> &nbsp; &nbsp;Font.Color = clRed<br> &nbsp; &nbsp;Font.Height = -15<br> &nbsp; &nbsp;Font.Name = '宋体'<br> &nbsp; &nbsp;Font.Style = []<br> &nbsp; &nbsp;ParentFont = False<br> &nbsp;end<br> &nbsp;object Label2: TLabel<br> &nbsp; &nbsp;Left = 328<br> &nbsp; &nbsp;Top = 544<br> &nbsp; &nbsp;Width = 48<br> &nbsp; &nbsp;Height = 15<br> &nbsp; &nbsp;Caption = '99/100'<br> &nbsp; &nbsp;Color = clBtnFace<br> &nbsp; &nbsp;Font.Charset = GB2312_CHARSET<br> &nbsp; &nbsp;Font.Color = clBlue<br> &nbsp; &nbsp;Font.Height = -15<br> &nbsp; &nbsp;Font.Name = '宋体'<br> &nbsp; &nbsp;Font.Style = []<br> &nbsp; &nbsp;ParentColor = False<br> &nbsp; &nbsp;ParentFont = False<br> &nbsp; &nbsp;Visible = False<br> &nbsp;end<br> &nbsp;object DBGrid1: TDBGrid<br> &nbsp; &nbsp;Left = 16<br> &nbsp; &nbsp;Top = 16<br> &nbsp; &nbsp;Width = 761<br> &nbsp; &nbsp;Height = 241<br> &nbsp; &nbsp;Ctl3D = False<br> &nbsp; &nbsp;DataSource = DataSource1<br> &nbsp; &nbsp;Font.Charset = GB2312_CHARSET<br> &nbsp; &nbsp;Font.Color = clBlack<br> &nbsp; &nbsp;Font.Height = -15<br> &nbsp; &nbsp;Font.Name = '宋体'<br> &nbsp; &nbsp;Font.Style = []<br> &nbsp; &nbsp;Options = [dgTitles, dgColumnResize, dgColLines, dgTabs, dgRowSelect, dgConfirmDelete, dgCancelOnExit]<br> &nbsp; &nbsp;ParentCtl3D = False<br> &nbsp; &nbsp;ParentFont = False<br> &nbsp; &nbsp;PopupMenu = PopupMenu1<br> &nbsp; &nbsp;ReadOnly = True<br> &nbsp; &nbsp;TabOrder = 0<br> &nbsp; &nbsp;TitleFont.Charset = GB2312_CHARSET<br> &nbsp; &nbsp;TitleFont.Color = clBlack<br> &nbsp; &nbsp;TitleFont.Height = -15<br> &nbsp; &nbsp;TitleFont.Name = '宋体'<br> &nbsp; &nbsp;TitleFont.Style = []<br> &nbsp; &nbsp;OnDblClick = DBGrid1DblClick<br> &nbsp; &nbsp;OnTitleClick = DBGrid1TitleClick<br> &nbsp; &nbsp;Columns = &lt;<br> &nbsp; &nbsp; &nbsp;item<br> &nbsp; &nbsp; &nbsp; &nbsp;Expanded = False<br> &nbsp; &nbsp; &nbsp; &nbsp;FieldName = 'Incabillid'<br> &nbsp; &nbsp; &nbsp; &nbsp;Title.Caption = '英.单号'<br> &nbsp; &nbsp; &nbsp; &nbsp;Width = 85<br> &nbsp; &nbsp; &nbsp; &nbsp;Visible = True<br> &nbsp; &nbsp; &nbsp;end<br> &nbsp; &nbsp; &nbsp;item<br> &nbsp; &nbsp; &nbsp; &nbsp;Expanded = False<br> &nbsp; &nbsp; &nbsp; &nbsp;FieldName = 'Incagysid'<br> &nbsp; &nbsp; &nbsp; &nbsp;Title.Caption = '英.供号'<br> &nbsp; &nbsp; &nbsp; &nbsp;Width = 81<br> &nbsp; &nbsp; &nbsp; &nbsp;Visible = True<br> &nbsp; &nbsp; &nbsp;end<br> &nbsp; &nbsp; &nbsp;item<br> &nbsp; &nbsp; &nbsp; &nbsp;Expanded = False<br> &nbsp; &nbsp; &nbsp; &nbsp;FieldName = 'Rhgysid'<br> &nbsp; &nbsp; &nbsp; &nbsp;Title.Caption = '润.供号'<br> &nbsp; &nbsp; &nbsp; &nbsp;Width = 68<br> &nbsp; &nbsp; &nbsp; &nbsp;Visible = True<br> &nbsp; &nbsp; &nbsp;end<br> &nbsp; &nbsp; &nbsp;item<br> &nbsp; &nbsp; &nbsp; &nbsp;Expanded = False<br> &nbsp; &nbsp; &nbsp; &nbsp;FieldName = 'Incagysname'<br> &nbsp; &nbsp; &nbsp; &nbsp;Title.Caption = '英.供应商'<br> &nbsp; &nbsp; &nbsp; &nbsp;Width = 171<br> &nbsp; &nbsp; &nbsp; &nbsp;Visible = True<br> &nbsp; &nbsp; &nbsp;end<br> &nbsp; &nbsp; &nbsp;item<br> &nbsp; &nbsp; &nbsp; &nbsp;Expanded = False<br> &nbsp; &nbsp; &nbsp; &nbsp;FieldName = 'Rhgysname'<br> &nbsp; &nbsp; &nbsp; &nbsp;Title.Caption = '润.供应商'<br> &nbsp; &nbsp; &nbsp; &nbsp;Width = 156<br> &nbsp; &nbsp; &nbsp; &nbsp;Visible = True<br> &nbsp; &nbsp; &nbsp;end<br> &nbsp; &nbsp; &nbsp;item<br> &nbsp; &nbsp; &nbsp; &nbsp;Expanded = False<br> &nbsp; &nbsp; &nbsp; &nbsp;FieldName = 'Incadate'<br> &nbsp; &nbsp; &nbsp; &nbsp;Title.Caption = '开单日期'<br> &nbsp; &nbsp; &nbsp; &nbsp;Width = 81<br> &nbsp; &nbsp; &nbsp; &nbsp;Visible = True<br> &nbsp; &nbsp; &nbsp;end<br> &nbsp; &nbsp; &nbsp;item<br> &nbsp; &nbsp; &nbsp; &nbsp;Expanded = False<br> &nbsp; &nbsp; &nbsp; &nbsp;FieldName = 'Je'<br> &nbsp; &nbsp; &nbsp; &nbsp;Title.Caption = '金额'<br> &nbsp; &nbsp; &nbsp; &nbsp;Visible = True<br> &nbsp; &nbsp; &nbsp;end&gt;<br> &nbsp;end<br> &nbsp;object DBGrid2: TDBGrid<br> &nbsp; &nbsp;Left = 16<br> &nbsp; &nbsp;Top = 296<br> &nbsp; &nbsp;Width = 761<br> &nbsp; &nbsp;Height = 241<br> &nbsp; &nbsp;Ctl3D = False<br> &nbsp; &nbsp;DataSource = DataSource2<br> &nbsp; &nbsp;Font.Charset = GB2312_CHARSET<br> &nbsp; &nbsp;Font.Color = clBlack<br> &nbsp; &nbsp;Font.Height = -15<br> &nbsp; &nbsp;Font.Name = '宋体'<br> &nbsp; &nbsp;Font.Style = []<br> &nbsp; &nbsp;Options = [dgTitles, dgColumnResize, dgColLines, dgTabs, dgRowSelect, dgConfirmDelete, dgCancelOnExit]<br> &nbsp; &nbsp;ParentCtl3D = False<br> &nbsp; &nbsp;ParentFont = False<br> &nbsp; &nbsp;PopupMenu = PopupMenu2<br> &nbsp; &nbsp;ReadOnly = True<br> &nbsp; &nbsp;TabOrder = 1<br> &nbsp; &nbsp;TitleFont.Charset = GB2312_CHARSET<br> &nbsp; &nbsp;TitleFont.Color = clBlack<br> &nbsp; &nbsp;TitleFont.Height = -15<br> &nbsp; &nbsp;TitleFont.Name = '宋体'<br> &nbsp; &nbsp;TitleFont.Style = []<br> &nbsp; &nbsp;OnDblClick = DBGrid2DblClick<br> &nbsp; &nbsp;OnTitleClick = DBGrid2TitleClick<br> &nbsp; &nbsp;Columns = &lt;<br> &nbsp; &nbsp; &nbsp;item<br> &nbsp; &nbsp; &nbsp; &nbsp;Expanded = False<br> &nbsp; &nbsp; &nbsp; &nbsp;FieldName = 'Incabillid'<br> &nbsp; &nbsp; &nbsp; &nbsp;Title.Caption = '英.单号'<br> &nbsp; &nbsp; &nbsp; &nbsp;Width = 85<br> &nbsp; &nbsp; &nbsp; &nbsp;Visible = True<br> &nbsp; &nbsp; &nbsp;end<br> &nbsp; &nbsp; &nbsp;item<br> &nbsp; &nbsp; &nbsp; &nbsp;Expanded = False<br> &nbsp; &nbsp; &nbsp; &nbsp;FieldName = 'Incagysid'<br> &nbsp; &nbsp; &nbsp; &nbsp;Title.Caption = '英.供号'<br> &nbsp; &nbsp; &nbsp; &nbsp;Width = 81<br> &nbsp; &nbsp; &nbsp; &nbsp;Visible = True<br> &nbsp; &nbsp; &nbsp;end<br> &nbsp; &nbsp; &nbsp;item<br> &nbsp; &nbsp; &nbsp; &nbsp;Expanded = False<br> &nbsp; &nbsp; &nbsp; &nbsp;FieldName = 'Rhgysid'<br> &nbsp; &nbsp; &nbsp; &nbsp;Title.Caption = '润.供号'<br> &nbsp; &nbsp; &nbsp; &nbsp;Width = 68<br> &nbsp; &nbsp; &nbsp; &nbsp;Visible = True<br> &nbsp; &nbsp; &nbsp;end<br> &nbsp; &nbsp; &nbsp;item<br> &nbsp; &nbsp; &nbsp; &nbsp;Expanded = False<br> &nbsp; &nbsp; &nbsp; &nbsp;FieldName = 'Incagysname'<br> &nbsp; &nbsp; &nbsp; &nbsp;Title.Caption = '英.供应商'<br> &nbsp; &nbsp; &nbsp; &nbsp;Width = 171<br> &nbsp; &nbsp; &nbsp; &nbsp;Visible = True<br> &nbsp; &nbsp; &nbsp;end<br> &nbsp; &nbsp; &nbsp;item<br> &nbsp; &nbsp; &nbsp; &nbsp;Expanded = False<br> &nbsp; &nbsp; &nbsp; &nbsp;FieldName = 'Rhgysname'<br> &nbsp; &nbsp; &nbsp; &nbsp;Title.Caption = '润.供应商'<br> &nbsp; &nbsp; &nbsp; &nbsp;Width = 156<br> &nbsp; &nbsp; &nbsp; &nbsp;Visible = True<br> &nbsp; &nbsp; &nbsp;end<br> &nbsp; &nbsp; &nbsp;item<br> &nbsp; &nbsp; &nbsp; &nbsp;Expanded = False<br> &nbsp; &nbsp; &nbsp; &nbsp;FieldName = 'Incadate'<br> &nbsp; &nbsp; &nbsp; &nbsp;Title.Caption = '开单日期'<br> &nbsp; &nbsp; &nbsp; &nbsp;Width = 81<br> &nbsp; &nbsp; &nbsp; &nbsp;Visible = True<br> &nbsp; &nbsp; &nbsp;end<br> &nbsp; &nbsp; &nbsp;item<br> &nbsp; &nbsp; &nbsp; &nbsp;Expanded = False<br> &nbsp; &nbsp; &nbsp; &nbsp;FieldName = 'Je'<br> &nbsp; &nbsp; &nbsp; &nbsp;Title.Caption = '金额'<br> &nbsp; &nbsp; &nbsp; &nbsp;Visible = True<br> &nbsp; &nbsp; &nbsp;end&gt;<br> &nbsp;end<br> &nbsp;object Button1: TButton<br> &nbsp; &nbsp;Left = 16<br> &nbsp; &nbsp;Top = 264<br> &nbsp; &nbsp;Width = 75<br> &nbsp; &nbsp;Height = 22<br> &nbsp; &nbsp;Caption = '增加 ▼'<br> &nbsp; &nbsp;Font.Charset = GB2312_CHARSET<br> &nbsp; &nbsp;Font.Color = clBlack<br> &nbsp; &nbsp;Font.Height = -15<br> &nbsp; &nbsp;Font.Name = '宋体'<br> &nbsp; &nbsp;Font.Style = []<br> &nbsp; &nbsp;ParentFont = False<br> &nbsp; &nbsp;TabOrder = 2<br> &nbsp; &nbsp;OnClick = Button1Click<br> &nbsp;end<br> &nbsp;object Button2: TButton<br> &nbsp; &nbsp;Left = 96<br> &nbsp; &nbsp;Top = 264<br> &nbsp; &nbsp;Width = 75<br> &nbsp; &nbsp;Height = 22<br> &nbsp; &nbsp;Caption = '全加▼▼'<br> &nbsp; &nbsp;Font.Charset = GB2312_CHARSET<br> &nbsp; &nbsp;Font.Color = clBlack<br> &nbsp; &nbsp;Font.Height = -15<br> &nbsp; &nbsp;Font.Name = '宋体'<br> &nbsp; &nbsp;Font.Style = []<br> &nbsp; &nbsp;ParentFont = False<br> &nbsp; &nbsp;TabOrder = 3<br> &nbsp; &nbsp;OnClick = Button2Click<br> &nbsp;end<br> &nbsp;object Button3: TButton<br> &nbsp; &nbsp;Left = 624<br> &nbsp; &nbsp;Top = 264<br> &nbsp; &nbsp;Width = 75<br> &nbsp; &nbsp;Height = 22<br> &nbsp; &nbsp;Caption = '删除▲'<br> &nbsp; &nbsp;Font.Charset = GB2312_CHARSET<br> &nbsp; &nbsp;Font.Color = clBlack<br> &nbsp; &nbsp;Font.Height = -15<br> &nbsp; &nbsp;Font.Name = '宋体'<br> &nbsp; &nbsp;Font.Style = []<br> &nbsp; &nbsp;ParentFont = False<br> &nbsp; &nbsp;TabOrder = 4<br> &nbsp; &nbsp;OnClick = Button3Click<br> &nbsp;end<br> &nbsp;object Button4: TButton<br> &nbsp; &nbsp;Left = 704<br> &nbsp; &nbsp;Top = 264<br> &nbsp; &nbsp;Width = 75<br> &nbsp; &nbsp;Height = 22<br> &nbsp; &nbsp;Caption = '全删▲▲'<br> &nbsp; &nbsp;Font.Charset = GB2312_CHARSET<br> &nbsp; &nbsp;Font.Color = clBlack<br> &nbsp; &nbsp;Font.Height = -15<br> &nbsp; &nbsp;Font.Name = '宋体'<br> &nbsp; &nbsp;Font.Style = []<br> &nbsp; &nbsp;ParentFont = False<br> &nbsp; &nbsp;TabOrder = 5<br> &nbsp; &nbsp;OnClick = Button4Click<br> &nbsp;end<br> &nbsp;object Button5: TButton<br> &nbsp; &nbsp;Left = 704<br> &nbsp; &nbsp;Top = 544<br> &nbsp; &nbsp;Width = 75<br> &nbsp; &nbsp;Height = 22<br> &nbsp; &nbsp;Caption = '开始转换'<br> &nbsp; &nbsp;Font.Charset = GB2312_CHARSET<br> &nbsp; &nbsp;Font.Color = clBlack<br> &nbsp; &nbsp;Font.Height = -15<br> &nbsp; &nbsp;Font.Name = '宋体'<br> &nbsp; &nbsp;Font.Style = []<br> &nbsp; &nbsp;ParentFont = False<br> &nbsp; &nbsp;TabOrder = 6<br> &nbsp; &nbsp;OnClick = Button5Click<br> &nbsp;end<br> &nbsp;object Button6: TButton<br> &nbsp; &nbsp;Left = 264<br> &nbsp; &nbsp;Top = 264<br> &nbsp; &nbsp;Width = 113<br> &nbsp; &nbsp;Height = 22<br> &nbsp; &nbsp;Caption = '读入英克数据'<br> &nbsp; &nbsp;Font.Charset = GB2312_CHARSET<br> &nbsp; &nbsp;Font.Color = clBlack<br> &nbsp; &nbsp;Font.Height = -15<br> &nbsp; &nbsp;Font.Name = '宋体'<br> &nbsp; &nbsp;Font.Style = []<br> &nbsp; &nbsp;ParentFont = False<br> &nbsp; &nbsp;TabOrder = 7<br> &nbsp; &nbsp;OnClick = Button6Click<br> &nbsp;end<br> &nbsp;object ProgressBar1: TProgressBar<br> &nbsp; &nbsp;Left = 16<br> &nbsp; &nbsp;Top = 561<br> &nbsp; &nbsp;Width = 681<br> &nbsp; &nbsp;Height = 7<br> &nbsp; &nbsp;TabOrder = 8<br> &nbsp; &nbsp;Visible = False<br> &nbsp;end<br> &nbsp;object Button7: TButton<br> &nbsp; &nbsp;Left = 432<br> &nbsp; &nbsp;Top = 264<br> &nbsp; &nbsp;Width = 113<br> &nbsp; &nbsp;Height = 22<br> &nbsp; &nbsp;Caption = '出库单转换'<br> &nbsp; &nbsp;TabOrder = 9<br> &nbsp; &nbsp;OnClick = Button7Click<br> &nbsp;end<br> &nbsp;object DataSource1: TDataSource<br> &nbsp; &nbsp;DataSet = Query1<br> &nbsp; &nbsp;Left = 16<br> &nbsp; &nbsp;Top = 448<br> &nbsp;end<br> &nbsp;object DataSource2: TDataSource<br> &nbsp; &nbsp;DataSet = Query2<br> &nbsp; &nbsp;Left = 152<br> &nbsp; &nbsp;Top = 448<br> &nbsp;end<br> &nbsp;object Table3: TTable<br> &nbsp; &nbsp;DatabaseName = 'tempdb'<br> &nbsp; &nbsp;TableName = 'Fromtemp.DB'<br> &nbsp; &nbsp;Left = 544<br> &nbsp; &nbsp;Top = 64<br> &nbsp;end<br> &nbsp;object Table4: TTable<br> &nbsp; &nbsp;DatabaseName = 'tempdb'<br> &nbsp; &nbsp;TableName = 'Totemp.DB'<br> &nbsp; &nbsp;Left = 352<br> &nbsp; &nbsp;Top = 448<br> &nbsp;end<br> &nbsp;object BatchMove1: TBatchMove<br> &nbsp; &nbsp;Left = 608<br> &nbsp; &nbsp;Top = 64<br> &nbsp;end<br> &nbsp;object Query1: TQuery<br> &nbsp; &nbsp;DatabaseName = 'tempdb'<br> &nbsp; &nbsp;Left = 192<br> &nbsp; &nbsp;Top = 264<br> &nbsp;end<br> &nbsp;object Query2: TQuery<br> &nbsp; &nbsp;DatabaseName = 'tempdb'<br> &nbsp; &nbsp;Left = 232<br> &nbsp; &nbsp;Top = 264<br> &nbsp;end<br> &nbsp;object Query3: TQuery<br> &nbsp; &nbsp;DatabaseName = 'tempdb'<br> &nbsp; &nbsp;Left = 272<br> &nbsp; &nbsp;Top = 96<br> &nbsp;end<br> &nbsp;object Query4: TQuery<br> &nbsp; &nbsp;DatabaseName = 'tempdb'<br> &nbsp; &nbsp;Left = 312<br> &nbsp; &nbsp;Top = 96<br> &nbsp;end<br> &nbsp;object Query5: TQuery<br> &nbsp; &nbsp;DatabaseName = 'DelphiInca'<br> &nbsp; &nbsp;SQL.Strings = (<br> &nbsp; &nbsp; &nbsp;<br> &nbsp; &nbsp; &nbsp; &nbsp;'SELECT &quot;BMS_SU_DOC_V&quot;.&quot;SUDOCID&quot;, &quot;BMS_SU_DOC_V&quot;.&quot;CREDATE&quot;, &quot;BMS_' +<br> &nbsp; &nbsp; &nbsp; &nbsp;'SU_DOC_V&quot;.&quot;SUPPLYID&quot;, &quot;BMS_SU_DOC_V&quot;.&quot;SUPPLYNAME&quot;, &quot;BMS_SU_DOC_V' +<br> &nbsp; &nbsp; &nbsp; &nbsp;'&quot;.&quot;TOTAL&quot;, &quot;BMS_SU_DOC_V&quot;.&quot;DTL_LINES&quot;,'<br> &nbsp; &nbsp; &nbsp;<br> &nbsp; &nbsp; &nbsp; &nbsp;'&quot;BMS_SU_DOC_V&quot;.&quot;INPUTMANID&quot;, &quot;BMS_SU_DOC_V&quot;.&quot;FACTCERTNO&quot;, &quot;BMS_S' +<br> &nbsp; &nbsp; &nbsp; &nbsp;'U_DOC_V&quot;.&quot;ARRIVEDATE&quot;, &quot;BMS_SU_DOC_V&quot;.&quot;DELIVERDATE&quot;, &quot;BMS_SU_DOC' +<br> &nbsp; &nbsp; &nbsp; &nbsp;'_V&quot;.&quot;TRANSDOCNO&quot;, '<br> &nbsp; &nbsp; &nbsp;<br> &nbsp; &nbsp; &nbsp; &nbsp;'&quot;BMS_SU_DOC_V&quot;.&quot;MEMO&quot;, &quot;BMS_SU_DOC_V&quot;.&quot;SUTYPEID&quot;, &quot;BMS_SU_DOC_V&quot;' +<br> &nbsp; &nbsp; &nbsp; &nbsp;'.&quot;SUPPLYOPCODE&quot;, &quot;BMS_SU_DOC_V&quot;.&quot;SUPPLYNO&quot;, &quot;BMS_SU_DOC_V&quot;.&quot;SUPP' +<br> &nbsp; &nbsp; &nbsp; &nbsp;'LYPINYIN&quot;, '<br> &nbsp; &nbsp; &nbsp;<br> &nbsp; &nbsp; &nbsp; &nbsp;'&quot;BMS_SU_DOC_V&quot;.&quot;INVOICEPRECISION&quot;, &quot;BMS_SU_DOC_V&quot;.&quot;USESTATUS&quot;, &quot;' +<br> &nbsp; &nbsp; &nbsp; &nbsp;'BMS_SU_DOC_V&quot;.&quot;INPUTMANNAME&quot;, &quot;BMS_SU_DOC_V&quot;.&quot;INPUTMANOPCODE&quot;, &quot;' +<br> &nbsp; &nbsp; &nbsp; &nbsp;'BMS_SU_DOC_V&quot;.&quot;INPUTMANPINYIN&quot;, '<br><br> &nbsp; &nbsp; &nbsp; &nbsp;'&quot;BMS_SU_DOC_V&quot;.&quot;INITFLAG&quot;, &quot;BMS_SU_DOC_V&quot;.&quot;ENTRYID&quot;, &quot;BMS_SU_DOC' +<br> &nbsp; &nbsp; &nbsp; &nbsp;'_V&quot;.&quot;ENTRYNAME&quot;, &quot;BMS_SU_DOC_V&quot;.&quot;ENGLISHSHORT&quot;, &quot;BMS_SU_DOC_V&quot;.&quot;' +<br> &nbsp; &nbsp; &nbsp; &nbsp;'FMID&quot;, &quot;BMS_SU_DOC_V&quot;.&quot;FMNAME&quot;, '<br> &nbsp; &nbsp; &nbsp;<br> &nbsp; &nbsp; &nbsp; &nbsp;'&quot;BMS_SU_DOC_V&quot;.&quot;EXCHANGE&quot; , &quot;BMS_SU_DOC_V&quot;.&quot;INVOICETYPE&quot;, BMS_SU' +<br> &nbsp; &nbsp; &nbsp; &nbsp;'_DOC_V.zxcolumn1, BMS_SU_DOC_V.zxcolumn2, BMS_SU_DOC_V.zxcolumn3' +<br> &nbsp; &nbsp; &nbsp; &nbsp;', BMS_SU_DOC_V.zxcolumn4, '<br> &nbsp; &nbsp; &nbsp;<br> &nbsp; &nbsp; &nbsp; &nbsp;'BMS_SU_DOC_V.zxcolumn5, BMS_SU_DOC_V.zxcolumn6, BMS_SU_DOC_V.zxc' +<br> &nbsp; &nbsp; &nbsp; &nbsp;'olumn7, BMS_SU_DOC_V.zxcolumn8, BMS_SU_DOC_V.zxcolumn9, BMS_SU_D' +<br> &nbsp; &nbsp; &nbsp; &nbsp;'OC_V.zxcolumn10 '<br> &nbsp; &nbsp; &nbsp;'FROM &quot;BMS_SU_DOC_V&quot; '<br> &nbsp; &nbsp; &nbsp;'where '<br> &nbsp; &nbsp; &nbsp;'bms_su_doc_v.sudocid in ('<br> &nbsp; &nbsp; &nbsp;'select bms_su_doc_v.sudocid '<br> &nbsp; &nbsp; &nbsp;'from bms_su_doc_v,bms_su_dtl_v '<br> &nbsp; &nbsp; &nbsp;<br> &nbsp; &nbsp; &nbsp; &nbsp;'where bms_su_doc_v.sudocid=bms_su_dtl_v.sudocid and BMS_SU_DOC_V' +<br> &nbsp; &nbsp; &nbsp; &nbsp;'.CREDATE between :startdate and :enddate and'<br><br> &nbsp; &nbsp; &nbsp; &nbsp;' (BMS_SU_DTL_V.sutypeid not in (select sutypeid from bms_sudoc_t' +<br> &nbsp; &nbsp; &nbsp; &nbsp;'ype where systype = 3)) '<br> &nbsp; &nbsp; &nbsp;<br> &nbsp; &nbsp; &nbsp; &nbsp;'and (BMS_SU_DTL_V.USESTATUS not in (0)) and (BMS_SU_DTL_V.USESTA' +<br> &nbsp; &nbsp; &nbsp; &nbsp;'TUS not in (0)) ) ')<br> &nbsp; &nbsp;Left = 472<br> &nbsp; &nbsp;Top = 256<br> &nbsp; &nbsp;ParamData = &lt;<br> &nbsp; &nbsp; &nbsp;item<br> &nbsp; &nbsp; &nbsp; &nbsp;DataType = ftUnknown<br> &nbsp; &nbsp; &nbsp; &nbsp;Name = 'startdate'<br> &nbsp; &nbsp; &nbsp; &nbsp;ParamType = ptUnknown<br> &nbsp; &nbsp; &nbsp;end<br> &nbsp; &nbsp; &nbsp;item<br> &nbsp; &nbsp; &nbsp; &nbsp;DataType = ftUnknown<br> &nbsp; &nbsp; &nbsp; &nbsp;Name = 'enddate'<br> &nbsp; &nbsp; &nbsp; &nbsp;ParamType = ptUnknown<br> &nbsp; &nbsp; &nbsp;end&gt;<br> &nbsp;end<br> &nbsp;object Query6: TQuery<br> &nbsp; &nbsp;DatabaseName = 'DelphiRhyao'<br> &nbsp; &nbsp;SQL.Strings = (<br> &nbsp; &nbsp; &nbsp;'select * from sitrh a,pos01.khda b'<br> &nbsp; &nbsp; &nbsp;'where a.b=b.dwbh')<br> &nbsp; &nbsp;Left = 408<br> &nbsp; &nbsp;Top = 256<br> &nbsp;end<br> &nbsp;object PopupMenu1: TPopupMenu<br> &nbsp; &nbsp;Left = 288<br> &nbsp; &nbsp;Top = 200<br> &nbsp; &nbsp;object N12121: TMenuItem<br> &nbsp; &nbsp; &nbsp;Caption = '供应商对应关系'<br> &nbsp; &nbsp; &nbsp;OnClick = N12121Click<br> &nbsp; &nbsp;end<br> &nbsp;end<br> &nbsp;object PopupMenu2: TPopupMenu<br> &nbsp; &nbsp;Left = 392<br> &nbsp; &nbsp;Top = 376<br> &nbsp; &nbsp;object N1: TMenuItem<br> &nbsp; &nbsp; &nbsp;Caption = '供应商对应关系'<br> &nbsp; &nbsp; &nbsp;OnClick = N1Click<br> &nbsp; &nbsp;end<br> &nbsp;end<br> &nbsp;object Query7: TQuery<br> &nbsp; &nbsp;DatabaseName = 'DelphiInca'<br> &nbsp; &nbsp;Left = 384<br> &nbsp; &nbsp;Top = 448<br> &nbsp;end<br> &nbsp;object Query8: TQuery<br> &nbsp; &nbsp;DatabaseName = 'DelphiRhyao'<br> &nbsp; &nbsp;SQL.Strings = (<br> &nbsp; &nbsp; &nbsp;'select * from gitrh a,pos01.cpda b '<br> &nbsp; &nbsp; &nbsp;'where a.b=b.cpbh and a.a=:incaid')<br> &nbsp; &nbsp;Left = 416<br> &nbsp; &nbsp;Top = 448<br> &nbsp; &nbsp;ParamData = &lt;<br> &nbsp; &nbsp; &nbsp;item<br> &nbsp; &nbsp; &nbsp; &nbsp;DataType = ftUnknown<br> &nbsp; &nbsp; &nbsp; &nbsp;Name = 'incaid'<br> &nbsp; &nbsp; &nbsp; &nbsp;ParamType = ptUnknown<br> &nbsp; &nbsp; &nbsp;end&gt;<br> &nbsp;end<br>end<br><br>出错的PAS程序代码:<br>unit Unit1;<br><br>interface<br><br>uses<br> &nbsp;Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<br> &nbsp;Dialogs, DB, DBTables, Grids, DBGrids, StdCtrls, Menus, ComCtrls;<br><br>type<br> &nbsp;TForm1 = class(TForm)<br> &nbsp; &nbsp;DBGrid1: TDBGrid;<br> &nbsp; &nbsp;DBGrid2: TDBGrid;<br> &nbsp; &nbsp;Button1: TButton;<br> &nbsp; &nbsp;Button2: TButton;<br> &nbsp; &nbsp;Button3: TButton;<br> &nbsp; &nbsp;Button4: TButton;<br> &nbsp; &nbsp;DataSource1: TDataSource;<br> &nbsp; &nbsp;DataSource2: TDataSource;<br> &nbsp; &nbsp;Button5: TButton;<br> &nbsp; &nbsp;Button6: TButton;<br> &nbsp; &nbsp;Table3: TTable;<br> &nbsp; &nbsp;Table4: TTable;<br> &nbsp; &nbsp;BatchMove1: TBatchMove;<br> &nbsp; &nbsp;Label1: TLabel;<br> &nbsp; &nbsp;Query1: TQuery;<br> &nbsp; &nbsp;Query2: TQuery;<br> &nbsp; &nbsp;Query3: TQuery;<br> &nbsp; &nbsp;Query4: TQuery;<br> &nbsp; &nbsp;Query5: TQuery;<br> &nbsp; &nbsp;Query6: TQuery;<br> &nbsp; &nbsp;PopupMenu1: TPopupMenu;<br> &nbsp; &nbsp;N12121: TMenuItem;<br> &nbsp; &nbsp;PopupMenu2: TPopupMenu;<br> &nbsp; &nbsp;N1: TMenuItem;<br> &nbsp; &nbsp;ProgressBar1: TProgressBar;<br> &nbsp; &nbsp;Label2: TLabel;<br> &nbsp; &nbsp;Query7: TQuery;<br> &nbsp; &nbsp;Query8: TQuery;<br> &nbsp; &nbsp;Button7: TButton;<br> &nbsp; &nbsp;procedure FormCreate(Sender: TObject);<br> &nbsp; &nbsp;procedure Button6Click(Sender: TObject);<br> &nbsp; &nbsp;procedure DBGrid1DblClick(Sender: TObject);<br> &nbsp; &nbsp;procedure DBGrid2DblClick(Sender: TObject);<br> &nbsp; &nbsp;procedure Button1Click(Sender: TObject);<br> &nbsp; &nbsp;procedure Button3Click(Sender: TObject);<br> &nbsp; &nbsp;procedure Button2Click(Sender: TObject);<br> &nbsp; &nbsp;procedure Button4Click(Sender: TObject);<br> &nbsp; &nbsp;procedure DBGrid1TitleClick(Column: TColumn);<br> &nbsp; &nbsp;procedure DBGrid2TitleClick(Column: TColumn);<br> &nbsp; &nbsp;procedure N12121Click(Sender: TObject);<br> &nbsp; &nbsp;procedure N1Click(Sender: TObject);<br> &nbsp; &nbsp;procedure Button5Click(Sender: TObject);<br> &nbsp; &nbsp;procedure Button7Click(Sender: TObject);<br> &nbsp;private<br> &nbsp; &nbsp;ls_bookmark_001:integer;<br> &nbsp; &nbsp;ls_bookmark_002:integer;<br> &nbsp; &nbsp;orderby01_s,orderby02_s:string;<br> &nbsp; &nbsp;orderby01_b,orderby02_b:boolean;<br> &nbsp; &nbsp;un_sel_count,sel_count:integer;<br> &nbsp; &nbsp;function mygyspassok:boolean;<br> &nbsp; &nbsp;function mygoodspassok:boolean;<br> &nbsp; &nbsp;procedure addone;<br> &nbsp; &nbsp;procedure addall;<br> &nbsp; &nbsp;procedure deleteone;<br> &nbsp; &nbsp;procedure deleteall;<br> &nbsp; &nbsp;procedure refreshinterface;<br> &nbsp; &nbsp;procedure refreshquerys01;<br> &nbsp; &nbsp;procedure refreshquerys02;<br> &nbsp; &nbsp;procedure refreshgys;<br> &nbsp; &nbsp;{ Private declarations }<br> &nbsp;public<br> &nbsp; &nbsp;current_usename:string;<br> &nbsp; &nbsp;{ Public declarations }<br> &nbsp;end;<br><br>var<br> &nbsp;Form1: TForm1;<br><br>implementation<br><br>uses Unit2, Unit5, Unit6, Unit4, Unit7;<br><br>{$R *.dfm}<br>function myCopytorh(<br>ls_Params1,ls_Params2,ls_Params3:tstrings;<br>ProgressBar1:TProgressBar;<br>Label2:TLabel;<br>current_usename:String<br>):boolean;stdcall;external 'Project.pas';<br><br>procedure TForm1.FormCreate(Sender: TObject);<br>begin<br> &nbsp; &nbsp; current_usename:=Application.Title;<br> &nbsp; &nbsp; Application.Title:='转换程序';<br> &nbsp; &nbsp; Self.Left:=(Screen.Width-Self.Width) div 2;<br> &nbsp; &nbsp; Self.Top:=(Screen.Height-Self.Height) div 2;<br> &nbsp; &nbsp; Table3.Active:=false;<br> &nbsp; &nbsp; Table3.EmptyTable;<br> &nbsp; &nbsp; Table4.Active:=false;<br> &nbsp; &nbsp; Table4.EmptyTable;<br> &nbsp; &nbsp; un_sel_count:=0;<br> &nbsp; &nbsp; sel_count:=0;<br> &nbsp; &nbsp; orderby01_s:='';<br> &nbsp; &nbsp; orderby02_s:='';<br> &nbsp; &nbsp; orderby01_b:=false;<br> &nbsp; &nbsp; orderby02_b:=false;<br> &nbsp; &nbsp; refreshquerys01;<br> &nbsp; &nbsp; refreshquerys02;<br> &nbsp; &nbsp; refreshinterface;<br>end;<br><br>procedure TForm1.Button6Click(Sender: TObject);<br>var<br> &nbsp; i:integer;<br> &nbsp; start_date,end_date:tdate;<br> &nbsp; ls_supply_array:array[1..6000,1..3] of string;<br> &nbsp; ls_supply_array_total:integer;<br>begin<br> &nbsp; &nbsp; form2:=tform2.Create(self);<br> &nbsp; &nbsp; form2.ShowModal;<br> &nbsp; &nbsp; if Form2.selectedok then begin<br> &nbsp; &nbsp; &nbsp; &nbsp;Query6.Active:=false;<br> &nbsp; &nbsp; &nbsp; &nbsp;Query6.Active:=true;<br> &nbsp; &nbsp; &nbsp; &nbsp;ls_supply_array_total:=0;<br> &nbsp; &nbsp; &nbsp; &nbsp;while not(Query6.Eof) do<br> &nbsp; &nbsp; &nbsp; &nbsp;begin<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ls_supply_array_total:=ls_supply_array_total+1;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ls_supply_array[ls_supply_array_total,1]:=Query6.Fieldbyname('a').AsString;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ls_supply_array[ls_supply_array_total,2]:=Query6.Fieldbyname('dwbh').AsString;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ls_supply_array[ls_supply_array_total,3]:=Query6.Fieldbyname('dwmc').AsString;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Query6.Next;<br> &nbsp; &nbsp; &nbsp; &nbsp;end;<br> &nbsp; &nbsp; &nbsp; &nbsp;Query6.Active:=false;<br> &nbsp; &nbsp; &nbsp; &nbsp;start_date:=form2.DateTimePicker1.Date;<br> &nbsp; &nbsp; &nbsp; &nbsp;end_date:=form2.DateTimePicker2.Date;<br> &nbsp; &nbsp; &nbsp; &nbsp;Query5.Active:=false;<br> &nbsp; &nbsp; &nbsp; &nbsp;query5.ParamByName('startdate').AsDate:=start_date;<br> &nbsp; &nbsp; &nbsp; &nbsp;query5.ParamByName('enddate').AsDate:=end_date;<br> &nbsp; &nbsp; &nbsp; &nbsp;Query5.Active:=true;<br> &nbsp; &nbsp; &nbsp; &nbsp;Table3.Active:=false;<br> &nbsp; &nbsp; &nbsp; &nbsp;Table3.EmptyTable;<br> &nbsp; &nbsp; &nbsp; &nbsp;Table3.Active:=true;<br> &nbsp; &nbsp; &nbsp; &nbsp;while not(query5.Eof) do<br> &nbsp; &nbsp; &nbsp; &nbsp;begin<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Table3.Append;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for i:=1 to ls_supply_array_total do begin<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (strtoint(ls_supply_array[i,1])=query5.Fieldbyname('supplyid').AsInteger) then begin<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Table3.FieldByName('Rhgysid').AsString:=ls_supply_array[i,2];<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Table3.FieldByName('rhgysname').AsString:=ls_supply_array[i,3];<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Table3.FieldByName('incabillid').AsInteger:=query5.Fieldbyname('sudocid').AsInteger;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Table3.FieldByName('incagysid').AsInteger:=query5.Fieldbyname('supplyid').AsInteger;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Table3.FieldByName('incagysname').AsString:=query5.Fieldbyname('supplyname').AsString;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Table3.FieldByName('je').AsFloat:=query5.Fieldbyname('total').AsFloat;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Table3.FieldByName('incadate').AsDateTime:=query5.Fieldbyname('arrivedate').AsDateTime;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Table3.FieldByName('rhdate').AsDateTime:=query5.Fieldbyname('arrivedate').AsDateTime;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Table3.Post;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Query5.Next;<br> &nbsp; &nbsp; &nbsp; &nbsp;end;<br> &nbsp; &nbsp; &nbsp; &nbsp;Table3.Active:=false;<br> &nbsp; &nbsp; &nbsp; &nbsp;refreshquerys01;<br> &nbsp; &nbsp; &nbsp; &nbsp;refreshquerys02;<br> &nbsp; &nbsp; &nbsp; &nbsp;refreshinterface;<br> &nbsp; &nbsp; end;<br> &nbsp; &nbsp; form2.Free;<br>end;<br><br>procedure TForm1.addone;<br>begin<br> &nbsp; &nbsp; if Query1.Fieldbyname('incabillid').AsInteger&gt;0 then begin<br> &nbsp; &nbsp; &nbsp; ls_bookmark_001:=query1.RecNo;<br> &nbsp; &nbsp; &nbsp; Query4.Active:=false;<br> &nbsp; &nbsp; &nbsp; Query4.SQL.Clear;<br> &nbsp; &nbsp; &nbsp; Query4.SQL.Add('insert into totemp.db (incabillid,incagysid,rhgysid,incagysname,rhgysname,incadate,rhdate,je) values (:pincabillid,:pincagysid,:prhgysid,:pincagysname,:prhgysname,:pincadate,:prhdate,:pje)');<br> &nbsp; &nbsp; &nbsp; Query4.ParamByName('pincabillid').AsInteger:=Query1.Fieldbyname('incabillid').AsInteger;<br> &nbsp; &nbsp; &nbsp; Query4.ParamByName('pincagysid').AsInteger:=Query1.Fieldbyname('incagysid').AsInteger;<br> &nbsp; &nbsp; &nbsp; Query4.ParamByName('prhgysid').AsString:=Query1.Fieldbyname('rhgysid').AsString;<br> &nbsp; &nbsp; &nbsp; Query4.ParamByName('pincagysname').AsString:=Query1.Fieldbyname('incagysname').AsString;<br> &nbsp; &nbsp; &nbsp; Query4.ParamByName('prhgysname').AsString:=Query1.Fieldbyname('rhgysname').AsString;<br> &nbsp; &nbsp; &nbsp; Query4.ParamByName('pincadate').AsDate:=Query1.Fieldbyname('incadate').AsDateTime;<br> &nbsp; &nbsp; &nbsp; Query4.ParamByName('prhdate').AsDate:=Query1.Fieldbyname('rhdate').AsDateTime;<br> &nbsp; &nbsp; &nbsp; Query4.ParamByName('pje').AsFloat:=Query1.Fieldbyname('je').AsFloat;<br> &nbsp; &nbsp; &nbsp; Query4.ExecSQL;<br> &nbsp; &nbsp; &nbsp; Query3.Active:=false;<br> &nbsp; &nbsp; &nbsp; Query3.SQL.Clear;<br> &nbsp; &nbsp; &nbsp; Query3.SQL.Add('delete from fromtemp.db where autoid=:pautoid');<br> &nbsp; &nbsp; &nbsp; Query3.ParamByName('pautoid').AsInteger:=Query1.Fieldbyname('autoid').AsInteger;<br> &nbsp; &nbsp; &nbsp; Query3.ExecSQL;<br> &nbsp; &nbsp; &nbsp; refreshquerys01;<br> &nbsp; &nbsp; &nbsp; refreshquerys02;<br> &nbsp; &nbsp; &nbsp; refreshinterface;<br> &nbsp; &nbsp; &nbsp; ls_bookmark_001:=-1;<br> &nbsp; &nbsp; end;<br>end;<br><br>procedure TForm1.addall;<br>begin<br> &nbsp; &nbsp; &nbsp; Table3.Active:=true;<br> &nbsp; &nbsp; &nbsp; Table4.Active:=true;<br> &nbsp; &nbsp; if Table3.IsEmpty=false then begin<br> &nbsp; &nbsp; &nbsp; BatchMove1.Source:=Table3;<br> &nbsp; &nbsp; &nbsp; BatchMove1.Destination:=Table4;<br> &nbsp; &nbsp; &nbsp; BatchMove1.Execute;<br> &nbsp; &nbsp; &nbsp; Table3.Active:=false;<br> &nbsp; &nbsp; &nbsp; Table3.EmptyTable;<br> &nbsp; &nbsp; &nbsp; refreshquerys01;<br> &nbsp; &nbsp; &nbsp; refreshquerys02;<br> &nbsp; &nbsp; &nbsp; refreshinterface;<br> &nbsp; &nbsp; end;<br> &nbsp; &nbsp; &nbsp; Table3.Active:=false;<br> &nbsp; &nbsp; &nbsp; Table4.Active:=false;<br>end;<br><br>procedure TForm1.deleteone;<br>begin<br> &nbsp; &nbsp; if Query2.Fieldbyname('incabillid').AsInteger&gt;0 then begin<br> &nbsp; &nbsp; &nbsp; ls_bookmark_002:=query2.RecNo;<br> &nbsp; &nbsp; &nbsp; Query4.Active:=false;<br> &nbsp; &nbsp; &nbsp; Query4.SQL.Clear;<br> &nbsp; &nbsp; &nbsp; Query4.SQL.Add('insert into fromtemp.db (incabillid,incagysid,rhgysid,incagysname,rhgysname,incadate,rhdate,je) values (:pincabillid,:pincagysid,:prhgysid,:pincagysname,:prhgysname,:pincadate,:prhdate,:pje)');<br> &nbsp; &nbsp; &nbsp; Query4.ParamByName('pincabillid').AsInteger:=Query2.Fieldbyname('incabillid').AsInteger;<br> &nbsp; &nbsp; &nbsp; Query4.ParamByName('pincagysid').AsInteger:=Query2.Fieldbyname('incagysid').AsInteger;<br> &nbsp; &nbsp; &nbsp; Query4.ParamByName('prhgysid').AsString:=Query2.Fieldbyname('rhgysid').AsString;<br> &nbsp; &nbsp; &nbsp; Query4.ParamByName('pincagysname').AsString:=Query2.Fieldbyname('incagysname').AsString;<br> &nbsp; &nbsp; &nbsp; Query4.ParamByName('prhgysname').AsString:=Query2.Fieldbyname('rhgysname').AsString;<br> &nbsp; &nbsp; &nbsp; Query4.ParamByName('pincadate').AsDate:=Query2.Fieldbyname('incadate').AsDateTime;<br> &nbsp; &nbsp; &nbsp; Query4.ParamByName('prhdate').AsDate:=Query2.Fieldbyname('rhdate').AsDateTime;<br> &nbsp; &nbsp; &nbsp; Query4.ParamByName('pje').AsFloat:=Query2.Fieldbyname('je').AsFloat;<br> &nbsp; &nbsp; &nbsp; Query4.ExecSQL;<br> &nbsp; &nbsp; &nbsp; Query3.Active:=false;<br> &nbsp; &nbsp; &nbsp; Query3.SQL.Clear;<br> &nbsp; &nbsp; &nbsp; Query3.SQL.Add('delete from totemp.db where autoid=:pautoid');<br> &nbsp; &nbsp; &nbsp; Query3.ParamByName('pautoid').AsInteger:=Query2.Fieldbyname('autoid').AsInteger;<br> &nbsp; &nbsp; &nbsp; Query3.ExecSQL;<br> &nbsp; &nbsp; &nbsp; refreshquerys01;<br> &nbsp; &nbsp; &nbsp; refreshquerys02;<br> &nbsp; &nbsp; &nbsp; refreshinterface;<br> &nbsp; &nbsp; &nbsp; ls_bookmark_002:=-1;<br> &nbsp; &nbsp; end;<br>end;<br><br>procedure TForm1.deleteall;<br>begin<br> &nbsp; &nbsp; &nbsp; Table3.Active:=true;<br> &nbsp; &nbsp; &nbsp; Table4.Active:=true;<br> &nbsp; &nbsp; if Table4.IsEmpty=false then begin<br> &nbsp; &nbsp; &nbsp; BatchMove1.Source:=Table4;<br> &nbsp; &nbsp; &nbsp; BatchMove1.Destination:=Table3;<br> &nbsp; &nbsp; &nbsp; BatchMove1.Execute;<br> &nbsp; &nbsp; &nbsp; Table4.Active:=false;<br> &nbsp; &nbsp; &nbsp; Table4.EmptyTable;<br> &nbsp; &nbsp; &nbsp; refreshquerys01;<br> &nbsp; &nbsp; &nbsp; refreshquerys02;<br> &nbsp; &nbsp; &nbsp; refreshinterface;<br> &nbsp; &nbsp; end;<br> &nbsp; &nbsp; Table3.Active:=false;<br> &nbsp; &nbsp; Table4.Active:=false;<br>end;<br><br>procedure TForm1.DBGrid1DblClick(Sender: TObject);<br>begin<br> &nbsp; &nbsp; addone;<br>end;<br><br>procedure TForm1.DBGrid2DblClick(Sender: TObject);<br>begin<br> &nbsp; &nbsp; deleteone;<br>end;<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>begin<br> &nbsp; &nbsp; addone;<br>end;<br><br>procedure TForm1.Button3Click(Sender: TObject);<br>begin<br> &nbsp; &nbsp; deleteone;<br>end;<br><br>procedure TForm1.Button2Click(Sender: TObject);<br>begin<br> &nbsp; &nbsp; addall;<br>end;<br><br>procedure TForm1.Button4Click(Sender: TObject);<br>begin<br> &nbsp; &nbsp; deleteall;<br>end;<br><br>procedure TForm1.refreshinterface;<br>begin<br> &nbsp; &nbsp; un_sel_count:=Query1.RecordCount;<br> &nbsp; &nbsp; sel_count:=Query2.RecordCount;<br> &nbsp; &nbsp; Label1.Caption:='可选单数:'+inttostr(un_sel_count)+';已选单数:'+inttostr(sel_count);<br> &nbsp; &nbsp; Button1.Enabled:=true;<br> &nbsp; &nbsp; Button2.Enabled:=true;<br> &nbsp; &nbsp; Button3.Enabled:=true;<br> &nbsp; &nbsp; Button4.Enabled:=true;<br> &nbsp; &nbsp; DBGrid1.PopupMenu:=PopupMenu1;<br> &nbsp; &nbsp; DBGrid2.PopupMenu:=PopupMenu2;<br> &nbsp; &nbsp; Button5.Enabled:=true;<br> &nbsp; &nbsp; if un_sel_count=0 then begin<br> &nbsp; &nbsp; &nbsp; DBGrid1.PopupMenu:=nil;<br> &nbsp; &nbsp; &nbsp; Button1.Enabled:=false;<br> &nbsp; &nbsp; &nbsp; Button2.Enabled:=false;<br> &nbsp; &nbsp; end;<br> &nbsp; &nbsp; if sel_count=0 then begin<br> &nbsp; &nbsp; &nbsp; DBGrid2.PopupMenu:=nil;<br> &nbsp; &nbsp; &nbsp; Button3.Enabled:=false;<br> &nbsp; &nbsp; &nbsp; Button4.Enabled:=false;<br> &nbsp; &nbsp; &nbsp; Button5.Enabled:=false;<br> &nbsp; &nbsp; end;<br>end;<br><br>procedure TForm1.refreshquerys01;<br>var<br> &nbsp; i:integer;<br>begin<br> &nbsp; &nbsp; Query1.Active:=false;<br> &nbsp; &nbsp; Query1.SQL.Clear;<br> &nbsp; &nbsp; query1.SQL.Add('select * from Fromtemp.DB');<br> &nbsp; &nbsp; if orderby01_s&lt;&gt;'' then begin<br> &nbsp; &nbsp; &nbsp; query1.SQL.Add('order by '+orderby01_s);<br> &nbsp; &nbsp; &nbsp; if orderby01_b then begin<br> &nbsp; &nbsp; &nbsp; &nbsp; query1.SQL.Add(' desc');<br> &nbsp; &nbsp; &nbsp; end;<br> &nbsp; &nbsp; end;<br> &nbsp; &nbsp; Query1.Active:=true;<br> &nbsp; &nbsp; if (query1.IsEmpty=false) and (ls_bookmark_001&lt;&gt;-1) then begin<br> &nbsp; &nbsp; &nbsp; &nbsp;query1.First;<br> &nbsp; &nbsp; &nbsp; &nbsp;Query1.MoveBy(ls_bookmark_001);<br> &nbsp; &nbsp; end;<br> &nbsp; &nbsp; for i:=0 to DBGrid1.Columns.Count-1 do begin<br> &nbsp; &nbsp; &nbsp; &nbsp;if ((copy(DBGrid1.Columns.Title.Caption,(length(DBGrid1.Columns.Title.Caption)-1),2)='▼') or<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(copy(DBGrid1.Columns.Title.Caption,(length(DBGrid1.Columns.Title.Caption)-1),2)='▲')) then begin<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DBGrid1.Columns.Title.Caption:=copy(DBGrid1.Columns.Title.Caption,1,(length(DBGrid1.Columns.Title.Caption)-2));<br> &nbsp; &nbsp; &nbsp; &nbsp;end;<br> &nbsp; &nbsp; &nbsp; &nbsp;if DBGrid1.Columns.DisplayName=orderby01_s then begin<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if orderby01_b then<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;begin<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DBGrid1.Columns.Title.Caption:=DBGrid1.Columns.Title.Caption+'▼';<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;else<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;begin<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DBGrid1.Columns.Title.Caption:=DBGrid1.Columns.Title.Caption+'▲';<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end;<br> &nbsp; &nbsp; &nbsp; &nbsp;end;<br> &nbsp; &nbsp; end;<br>end;<br><br>procedure TForm1.refreshquerys02;<br>var<br> &nbsp; i:integer;<br>begin<br> &nbsp; &nbsp; Query2.Active:=false;<br> &nbsp; &nbsp; Query2.SQL.Clear;<br> &nbsp; &nbsp; query2.SQL.Add('select * from Totemp.DB');<br> &nbsp; &nbsp; if orderby02_s&lt;&gt;'' then begin<br> &nbsp; &nbsp; &nbsp; query2.SQL.Add('order by '+orderby02_s);<br> &nbsp; &nbsp; &nbsp; if orderby02_b then begin<br> &nbsp; &nbsp; &nbsp; &nbsp; query2.SQL.Add(' desc');<br> &nbsp; &nbsp; &nbsp; end;<br> &nbsp; &nbsp; end;<br> &nbsp; &nbsp; Query2.Active:=true;<br> &nbsp; &nbsp; if (query2.IsEmpty=false) and (ls_bookmark_002&lt;&gt;-1) then begin<br> &nbsp; &nbsp; &nbsp; &nbsp;query2.First;<br> &nbsp; &nbsp; &nbsp; &nbsp;Query2.MoveBy(ls_bookmark_002);<br> &nbsp; &nbsp; end;<br> &nbsp; &nbsp; for i:=0 to DBGrid2.Columns.Count-1 do begin<br> &nbsp; &nbsp; &nbsp; &nbsp;if ((copy(DBGrid2.Columns.Title.Caption,(length(DBGrid2.Columns.Title.Caption)-1),2)='▼') or<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(copy(DBGrid2.Columns.Title.Caption,(length(DBGrid2.Columns.Title.Caption)-1),2)='▲')) then begin<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DBGrid2.Columns.Title.Caption:=copy(DBGrid2.Columns.Title.Caption,1,(length(DBGrid2.Columns.Title.Caption)-2));<br> &nbsp; &nbsp; &nbsp; &nbsp;end;<br> &nbsp; &nbsp; &nbsp; &nbsp;if DBGrid2.Columns.DisplayName=orderby02_s then begin<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if orderby02_b then<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;begin<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DBGrid2.Columns.Title.Caption:=DBGrid2.Columns.Title.Caption+'▼';<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;else<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;begin<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DBGrid2.Columns.Title.Caption:=DBGrid2.Columns.Title.Caption+'▲';<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end;<br> &nbsp; &nbsp; &nbsp; &nbsp;end;<br> &nbsp; &nbsp; end;<br>end;<br><br>procedure TForm1.DBGrid1TitleClick(Column: TColumn);<br>begin<br> &nbsp; &nbsp; &nbsp; &nbsp;if Column.DisplayName=orderby01_s then<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;begin<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; orderby01_b:=not(orderby01_b);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end<br> &nbsp; &nbsp; &nbsp; &nbsp;else<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;begin<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; orderby01_s:=Column.DisplayName;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; orderby01_b:=false;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end;<br> &nbsp; &nbsp; &nbsp; &nbsp;refreshquerys01;<br>end;<br><br>procedure TForm1.DBGrid2TitleClick(Column: TColumn);<br>begin<br> &nbsp; &nbsp; &nbsp; &nbsp;if Column.DisplayName=orderby02_s then<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;begin<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; orderby02_b:=not(orderby02_b);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end<br> &nbsp; &nbsp; &nbsp; &nbsp;else<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;begin<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; orderby02_s:=Column.DisplayName;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; orderby02_b:=false;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end;<br> &nbsp; &nbsp; &nbsp; &nbsp;refreshquerys02;<br>end;<br><br>procedure TForm1.N12121Click(Sender: TObject);<br>begin<br> &nbsp; &nbsp; form5:=tform5.Create(self);<br> &nbsp; &nbsp; form5.incaoid:=Query1.Fieldbyname('incagysid').AsInteger;<br> &nbsp; &nbsp; form5.rhid:=Query1.Fieldbyname('rhgysid').AsString;<br> &nbsp; &nbsp; form5.ShowModal;<br> &nbsp; &nbsp; if Form5.Sel_Id&lt;&gt;'' then begin<br> &nbsp; &nbsp; &nbsp; refreshgys;<br> &nbsp; &nbsp; end;<br> &nbsp; &nbsp; form5.Free;<br>end;<br><br>procedure TForm1.N1Click(Sender: TObject);<br>begin<br> &nbsp; &nbsp; form5:=tform5.Create(self);<br> &nbsp; &nbsp; form5.incaoid:=Query2.Fieldbyname('incagysid').AsInteger;<br> &nbsp; &nbsp; form5.rhid:=Query2.Fieldbyname('rhgysid').AsString;<br> &nbsp; &nbsp; form5.ShowModal;<br> &nbsp; &nbsp; if Form5.Sel_Id&lt;&gt;'' then begin<br> &nbsp; &nbsp; &nbsp; refreshgys;<br> &nbsp; &nbsp; end;<br> &nbsp; &nbsp; form5.Free;<br>end;<br><br>procedure TForm1.refreshgys;<br>var<br> &nbsp; i:integer;<br> &nbsp; ls_supply_array:array[1..6000,1..3] of string;<br> &nbsp; ls_supply_array_total:integer;<br>begin<br> &nbsp; &nbsp; &nbsp;Query6.Active:=false;<br> &nbsp; &nbsp; &nbsp;Query6.Active:=true;<br> &nbsp; &nbsp; &nbsp;ls_supply_array_total:=0;<br> &nbsp; &nbsp; &nbsp;while not(Query6.Eof) do<br> &nbsp; &nbsp; &nbsp;begin<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ls_supply_array_total:=ls_supply_array_total+1;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ls_supply_array[ls_supply_array_total,1]:=Query6.Fieldbyname('a').AsString;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ls_supply_array[ls_supply_array_total,2]:=Query6.Fieldbyname('dwbh').AsString;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ls_supply_array[ls_supply_array_total,3]:=Query6.Fieldbyname('dwmc').AsString;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Query6.Next;<br> &nbsp; &nbsp; &nbsp;end;<br> &nbsp; &nbsp; &nbsp;Table3.Active:=true;<br> &nbsp; &nbsp; &nbsp;while not(Table3.Eof) do<br> &nbsp; &nbsp; &nbsp;begin<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Table3.Edit;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for i:=1 to ls_supply_array_total do begin<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (strtoint(ls_supply_array[i,1])=Table3.Fieldbyname('incagysid').AsInteger) then begin<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Table3.FieldByName('Rhgysid').AsString:=ls_supply_array[i,2];<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Table3.FieldByName('rhgysname').AsString:=ls_supply_array[i,3];<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Table3.Post;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Table3.Next;<br> &nbsp; &nbsp; &nbsp;end;<br> &nbsp; &nbsp; &nbsp;Table3.Active:=false;<br> &nbsp; &nbsp; &nbsp;Table4.Active:=true;<br> &nbsp; &nbsp; &nbsp;while not(Table4.Eof) do<br> &nbsp; &nbsp; &nbsp;begin<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Table4.Edit;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for i:=1 to ls_supply_array_total do begin<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (strtoint(ls_supply_array[i,1])=Table4.Fieldbyname('incagysid').AsInteger) then begin<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Table4.FieldByName('Rhgysid').AsString:=ls_supply_array[i,2];<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Table4.FieldByName('rhgysname').AsString:=ls_supply_array[i,3];<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Table4.Post;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Table4.Next;<br> &nbsp; &nbsp; &nbsp;end;<br> &nbsp; &nbsp; &nbsp;Table4.Active:=false;<br> &nbsp; &nbsp; &nbsp;refreshquerys01;<br> &nbsp; &nbsp; &nbsp;refreshquerys02;<br> &nbsp; &nbsp; &nbsp;refreshinterface;<br>end;<br><br>function TForm1.mygyspassok:boolean;<br>var<br> &nbsp; pass_ok:boolean;<br>begin<br> &nbsp; &nbsp; pass_ok:=true;<br> &nbsp; &nbsp; Table4.Active:=false;<br> &nbsp; &nbsp; Table4.Active:=true;<br> &nbsp; &nbsp; Table4.First;<br> &nbsp; &nbsp; while not(Table4.Eof) do<br> &nbsp; &nbsp; begin<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ((Table4.fieldbyname('rhgysname').AsString='') or (Table4.fieldbyname('rhgysid').AsString='')) then begin<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pass_ok:=false;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ShowMessage('尚有未对应的供应商'+#13+'请手工加以对应!');<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Table4.Next;<br> &nbsp; &nbsp; end;<br> &nbsp; &nbsp; Table4.Active:=false;<br> &nbsp; &nbsp; Result:=pass_ok;<br>end;<br><br>function TForm1.mygoodspassok:boolean;<br>var<br> &nbsp; pass_ok:boolean;<br> &nbsp; ls_where:string;<br>begin<br> &nbsp; &nbsp; pass_ok:=true;<br> &nbsp; &nbsp; Table4.Active:=false;<br> &nbsp; &nbsp; Table4.Active:=true;<br> &nbsp; &nbsp; Table4.First;<br> &nbsp; &nbsp; ProgressBar1.Position:=0;<br> &nbsp; &nbsp; ProgressBar1.Visible:=true;<br> &nbsp; &nbsp; ProgressBar1.Max:=Table4.RecordCount*100;<br> &nbsp; &nbsp; ProgressBar1.Min:=0;<br> &nbsp; &nbsp; Label2.caption:='0/'+inttostr(Table4.RecordCount);<br> &nbsp; &nbsp; Self.Refresh;<br> &nbsp; &nbsp; Label2.Visible:=true;<br> &nbsp; &nbsp; while not(Table4.Eof) do<br> &nbsp; &nbsp; begin<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ls_where:='where sudocid='''+Format('%10.10d',[Table4.Fieldbyname('incabillid').Asinteger])+'''';<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; query7.Active:=False;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Query7.SQL.Clear;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; query7.SQL.Add('select * from kcm.bms_su_dtl_v');<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; query7.SQL.Add(ls_where);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; query7.Active:=true;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ProgressBar1.Step:=100 div query7.RecordCount;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while not(query7.Eof) do<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; begin<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;query8.Active:=false;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Query8.ParamByName('incaid').AsInteger:=Query7.Fieldbyname('goodsid').AsInteger;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;query8.Active:=true; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (query8.IsEmpty) then begin<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;form6:=tform6.Create(self);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;form6.incaoid:=Query7.Fieldbyname('goodsid').AsInteger;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;form6.rhid:='';<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;form6.ShowModal;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if Form6.Sel_Id='' then begin<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ShowMessage('用户中断了操作。。。');<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pass_ok:=false;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;form6.Free;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;query8.Active:=false;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ProgressBar1.StepIt;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;query7.Next;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; query7.Active:=False;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if pass_ok=false then begin<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Break;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Label2.caption:=inttostr(Table4.Recno)+'/'+inttostr(Table4.RecordCount);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Self.Refresh;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Table4.Next;<br> &nbsp; &nbsp; end;<br> &nbsp; &nbsp; Table4.Active:=false;<br> &nbsp; &nbsp; ProgressBar1.Visible:=false;<br> &nbsp; &nbsp; Label2.Visible:=false;<br> &nbsp; &nbsp; Result:=pass_ok;<br>end;<br><br>procedure TForm1.Button5Click(Sender: TObject);<br>var<br> &nbsp; pass_ok:boolean;<br> &nbsp; jiejieii,jiejiels_i1,jiejiels_i2,jiejiels_i3:integer;<br> &nbsp; jiejiels_string:string;<br> &nbsp; jiejiels_string02:string;<br>begin<br> &nbsp; &nbsp; pass_ok:=true;<br> &nbsp; &nbsp; if pass_ok then begin<br> &nbsp; &nbsp; &nbsp; pass_ok:=mygyspassok;<br> &nbsp; &nbsp; end;<br> &nbsp; &nbsp; if pass_ok then begin<br> &nbsp; &nbsp; &nbsp; pass_ok:=mygoodspassok;<br> &nbsp; &nbsp; &nbsp; if pass_ok=false then begin<br> &nbsp; &nbsp; &nbsp; &nbsp; ShowMessage('尚有未对应的商品资料'+#13+'操作终止!');<br> &nbsp; &nbsp; &nbsp; end;<br> &nbsp; &nbsp; end;<br> &nbsp; &nbsp; if pass_ok then<br> &nbsp; &nbsp; &nbsp; begin<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;myCopytorh(DataModule4.Database1.Params,DataModule4.Database2.Params,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DataModule4.Database3.Params,ProgressBar1,Label2,current_usename);<br> &nbsp; &nbsp; &nbsp; end<br> &nbsp; &nbsp; else<br> &nbsp; &nbsp; &nbsp; &nbsp; begin<br> &nbsp; &nbsp; &nbsp; &nbsp; end;<br>end;<br><br>procedure TForm1.Button7Click(Sender: TObject);<br>var<br> &nbsp; form7:Tform7;<br> &nbsp; jiejieii,jiejiels_i1,jiejiels_i2,jiejiels_i3:integer;<br> &nbsp; jiejiels_string:string;<br> &nbsp; jiejiels_string02:string;<br>begin<br> &nbsp; &nbsp; form7:=tform7.Create(self);<br> &nbsp; &nbsp; form7.ShowModal;<br> &nbsp; &nbsp; form7.free;<br>end;<br><br>end.
 
看看是否有未分配内存访问或指针错误之类的问题...
 
你这么多代码无法告诉你错误是什么,一个办法就是设置调试断点,然后一步一步调试,看在什么位置出错了,然后仔细检查,要不你不锁定错误的范围,没有办法解决问题!
 
有的程序,在IDE环境中直接执行就有问题,先编译好再执行就没有问题,特别是有某些第三方控件存在的情况下。
 
添加“地址断点”来跟踪看看。<br><br>ps: 你代码的风格真不好,控件名称都没有,看的晕吧
 
是啊,看得都晕
 
我也遇到这种情况,这可能要重新安装DELPHI,如果重新安装DELPHI仍不能解决问题,请重新安装操作系统即可
 
请看这个贴子<br>http://www.delphibbs.com/delphibbs/dispq.asp?lid=3466561
 
以前我用BDE也是经常出现这个错误提示,后来改为使用ADO,就没有了。<br>你不妨试一试ADO。
 
后退
顶部