插入表错误!!(100分)

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

xinyang

Unregistered / Unconfirmed
GUEST, unregistred user!
BASE:=14;<br>With ADOQuery1 do<br> &nbsp; &nbsp; &nbsp; &nbsp;begin<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Close;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SQL.Clear;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SQLCOMMAND:='Insert into Trade (Com_No,TID,ASN,RECKIND,AMOUNT,TTC,DATE,CTC,BALANCE,TAC,YG,OILNO,GUNNO,PPU,VOLUME,PT,PKEYINFO,GTC,MAC,VER,Rec_Time) Values (:P1,:P2,:P3,:P4,:P5,:P6,:P7,:P8,:P9,:P10,:P11,:P12,:P13,:P14,:P15,:P16,:P17,:P18,:P19,:P20,P21)';<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SQL.Add(SQLCOMMAND);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;parameters[0].Value :=IntToHex(RecComm_No,2);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;parameters[1].Value := copy(Temp_Str,BASE+1,12); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;parameters[2].Value :=copy(Temp_Str,BASE+13,20); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>parameters[3].Value :=copy(Temp_Str,BASE+33,2); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>parameters[4].Value :=copy(Temp_Str,BASE+35,8);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;parameters[5].Value :=copy(Temp_Str,BASE+43,8);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;parameters[6].Value :=copy(Temp_Str,BASE+51,14);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;parameters[7].Value :=copy(Temp_Str,BASE+65,4);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;parameters[8].Value :=copy(Temp_Str,BASE+69,8);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;parameters[9].Value :=copy(Temp_Str,BASE+77,8);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;parameters[10].Value :=copy(Temp_Str,BASE+85,2); <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;parameters[11].Value :=copy(Temp_Str,BASE+87,2); <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;parameters[12].Value :=copy(Temp_Str,BASE+89,2); <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;parameters[13].Value :=copy(Temp_Str,BASE+91,4); <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;parameters[14].Value :=copy(Temp_Str,BASE+95,6); <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;parameters[15].Value :=copy(Temp_Str,BASE+101,8);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;parameters[16].Value :=copy(Temp_Str,BASE+109,2);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;parameters[17].Value :=copy(Temp_Str,BASE+111,4);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;parameters[18].Value :=copy(Temp_Str,BASE+115,8);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;parameters[19].Value :=copy(Temp_Str,BASE+123,2);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;parameters[20].Value:=formatdatetime('yyyymmddhhmmss', now);<br> &nbsp; &nbsp; &nbsp; &nbsp;Prepared;<br> &nbsp; &nbsp; &nbsp; &nbsp;ExecSQL;<br>报 list index out of bounds(20) &nbsp;错,请问是哪里出错了,真晕!
 
是不是p21那儿有问题 ?
 
p21前怎么没有冒号呢? 这是我的猜测 。
 
加了:号变成(‘Inset Into 语句的语法错误’)了
 
已经搞定了,字段名不能用DATE
 
后退
顶部