我使用Microsoft Jet引擎和Microsoft Access(*.mdb)数据库的应用程序在Delphi 7中出现错误.我通过TADOQuery组件建立连接.错误显示"参数iPointsNew没有默认值",只有在更新/插入查询中使用整数变量时才会发生:
frmHome.adoqryInLoop.SQL.Text := 'UPDATE Users SET Points = iPointsNew WHERE UID = "'+sUID+'"';
Run Code Online (Sandbox Code Playgroud)
事件处理程序的代码如下:
procedure TfrmAdmin.bmbSubmitClick(Sender: TObject);
var
sScore, sEID, sPrediction, sUID : String;
iRecordCount, x, iPos, iLength, iActual, iPoints, iPointsNew : Integer;
rPrediction : Real;
begin
// Assign values to variables
sScore := IntToStr(sedSuthies.Value) + '-' + IntToStr(sedOpponent.Value);
iActual := sedSuthies.Value + sedOpponent.Value;
sEID := frmHome.arrEID[lstEvents.ItemIndex];
// Update the score for the event in the database
frmHome.adoqryMain.Active := False;
frmHome.adoqryMain.SQL.Clear;
frmHome.adoqryMain.SQL.Text := 'UPDATE Events SET Score …Run Code Online (Sandbox Code Playgroud)