Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/delphi/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/unit-testing/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Delphi 在数据库中应用的学分制(MyDAC)_Delphi_Mydac - Fatal编程技术网

Delphi 在数据库中应用的学分制(MyDAC)

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

我想建立一个学分制。如果有用户信用“警告:您有信用!数量:[列中的Jeton值]”,如果没有用户信用“警告:您没有信用!”我使用了MyDAC组件

Jeton:用户信用栏(在数据库中)

我怎么做

我试着让

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…:)任务投诉。