//rdmStudy
procedure TrdmUserStudy.SubmitResult(const vUserID:WideString;const vTestType: WideString; vResult: Single; var vRe: OleVariant);
begin
//增添考试记录
qryMain.Close;
qryMain.SQL.Add('INSERT INTO testDetail');
qryMain.SQL.Add('(userName , testType , correctRate) VALUES');
qryMain.SQL.Add('(:pUserID , :pSubject , :pResult)');
qryMain.Parameters.ParamValues['pUserID'] := vUserID;
qryMain.Parameters.ParamValues['pSubject'] := vTestType;
qryMain.Parameters.ParamValues['pResult'] := vResult;
if qryMain.Prepared = False then
begin
qryMain.Prepared := True;
end;
qryMain.ExecSQL;
qryMain.Close;
qryMain.SQL.Clear;
qryMain.SQL.Add('SELECT rematkContent FROM re');
qryMain.SQL.Add('WHERE reNumber = :pSubject') ;
if vResult < 0.6 then
begin
qryMain.Parameters.ParamValues['pSubject'] := '1' ;
end
else if (vResult >= 0.6) and (vResult < 0.7) then
begin
qryMain.Parameters.ParamValues['pSubject'] := '2' ;
end
else if (vResult >= 0.7) and (vResult < 0.8) then
begin
qryMain.Parameters.ParamValues['pSubject'] := '3';
end
else if (vResult >= 0.8) and (vResult < 0.9) then
begin
qryMain.Parameters.ParamValues['pSubject'] := '4';
end
else
begin
qryMain.Parameters.ParamValues['pSubject'] := '5';
end;
if qryMain.Prepared = False then
begin
qryMain.Prepared := True;
end;
MainForm.Label1.Caption := qryMain.SQL.Text;
qryMain.Open;
vRe := Trim(qryMain.FieldByName('rematkContent').AsString);
qryMain.Close;
end;
procedure TrdmUserStudy.SubmitResult(const vUserID:WideString;const vTestType: WideString; vResult: Single; var vRe: OleVariant);
begin
//增添考试记录
qryMain.Close;
qryMain.SQL.Add('INSERT INTO testDetail');
qryMain.SQL.Add('(userName , testType , correctRate) VALUES');
qryMain.SQL.Add('(:pUserID , :pSubject , :pResult)');
qryMain.Parameters.ParamValues['pUserID'] := vUserID;
qryMain.Parameters.ParamValues['pSubject'] := vTestType;
qryMain.Parameters.ParamValues['pResult'] := vResult;
if qryMain.Prepared = False then
begin
qryMain.Prepared := True;
end;
qryMain.ExecSQL;
qryMain.Close;
qryMain.SQL.Clear;
qryMain.SQL.Add('SELECT rematkContent FROM re');
qryMain.SQL.Add('WHERE reNumber = :pSubject') ;
if vResult < 0.6 then
begin
qryMain.Parameters.ParamValues['pSubject'] := '1' ;
end
else if (vResult >= 0.6) and (vResult < 0.7) then
begin
qryMain.Parameters.ParamValues['pSubject'] := '2' ;
end
else if (vResult >= 0.7) and (vResult < 0.8) then
begin
qryMain.Parameters.ParamValues['pSubject'] := '3';
end
else if (vResult >= 0.8) and (vResult < 0.9) then
begin
qryMain.Parameters.ParamValues['pSubject'] := '4';
end
else
begin
qryMain.Parameters.ParamValues['pSubject'] := '5';
end;
if qryMain.Prepared = False then
begin
qryMain.Prepared := True;
end;
MainForm.Label1.Caption := qryMain.SQL.Text;
qryMain.Open;
vRe := Trim(qryMain.FieldByName('rematkContent').AsString);
qryMain.Close;
end;
procedure TMainForm.btSubmitClick(Sender: TObject);
var
Re : Variant;
begin
sckStudy.AppServer.SubmitResult(examUser.Text,cbExamType.Text,StrToFloat(examResult.Text),Re);
showmessage(Re);
end;end.
参数的输入输出,一般如果是客户端传给服务器,用[in]
2、如果还不行,把你的服务端重新编译,反注册一下,然后重新注册。
在type library里面删掉一个方法后重新编译工程居然不报错!!!!!!
为什么???????