Delphi 在数据库中应用的学分制(MyDAC)
我想建立一个学分制。如果有用户信用“警告:您有信用!数量:[列中的Jeton值]”,如果没有用户信用“警告:您没有信用!”我使用了MyDAC组件 Jeton:用户信用栏(在数据库中) 我怎么做 我试着让Delphi 在数据库中应用的学分制(MyDAC),delphi,mydac,Delphi,Mydac,我想建立一个学分制。如果有用户信用“警告:您有信用!数量:[列中的Jeton值]”,如果没有用户信用“警告:您没有信用!”我使用了MyDAC组件 Jeton:用户信用栏(在数据库中) 我怎么做 我试着让 MyQuery1.Close; MyQuery1.SQL.Text :=' select* from uyeler '+ 'where nick=:0 and jeton=:1'; MyQuery1.Params[0].AsString:=Edit
MyQuery1.Close;
MyQuery1.SQL.Text :=' select* from uyeler '+
'where nick=:0 and jeton=:1';
MyQuery1.Params[0].AsString:=Edit1.Text;
MyQuery1.Params[1].AsString:=?must?;
MyQuery1.open;
If MyQuery1.RecordCount=0 Then
Begin
MessageDlg('warning: you have not credit!', mtWarning,[mbOK],0)
End
Else
Begin
MessageDlg('warning: you have credit! quantity: (Jeton value in column)', mtWarning,[mbOK],0)
End;
如果
jeton
字段是信用,您可以这样写
MyQuery1.Close;
MyQuery1.SQL.Text :='select jeton from uyeler where nick=:0';
MyQuery1.Params[0].AsString:=Edit1.Text;
MyQuery1.open;
If (MyQuery1.IsEmpty) or (MyQuery1.FieldByName('jeton').AsDouble<=0) Then
Begin
MessageDlg('warning: you have not credit!', mtWarning,[mbOK],0)
End
Else
Begin
MessageDlg(Format('warning: you have credit! quantity: (%n)',[MyQuery1.FieldByName('jeton').AsDouble]), mtWarning,[mbOK],0);
end;
MyQuery1.关闭;
MyQuery1.SQL.Text:=“从uyeler中选择jeton,其中nick=:0';
MyQuery1.Params[0]。关联字符串:=Edit1.Text;
MyQuery1.open;
如果(MyQuery1.IsEmpty)或(MyQuery1.FieldByName('jeton').AsDouble如果jeton
字段是信用,您可以这样写
MyQuery1.Close;
MyQuery1.SQL.Text :='select jeton from uyeler where nick=:0';
MyQuery1.Params[0].AsString:=Edit1.Text;
MyQuery1.open;
If (MyQuery1.IsEmpty) or (MyQuery1.FieldByName('jeton').AsDouble<=0) Then
Begin
MessageDlg('warning: you have not credit!', mtWarning,[mbOK],0)
End
Else
Begin
MessageDlg(Format('warning: you have credit! quantity: (%n)',[MyQuery1.FieldByName('jeton').AsDouble]), mtWarning,[mbOK],0);
end;
MyQuery1.关闭;
MyQuery1.SQL.Text:=“从uyeler中选择jeton,其中nick=:0';
MyQuery1.Params[0]。关联字符串:=Edit1.Text;
MyQuery1.open;
如果(MyQuery1.IsEmpty)或(MyQuery1.FieldByName('jeton').AsDouble谢谢但是,[Error]Unit2.pas(101):未声明的标识符:'AsDouble'Thank you…:)任务投诉。谢谢但是,[Error]Unit2.pas(101):未声明的标识符:'AsDouble'Thank you…:)任务投诉。