【问题标题】:Credit system to make application in database (MyDAC)在数据库中申请的信用系统(MyDAC)
【发布时间】:2012-08-05 18:19:20
【问题描述】:

我想做一个信用系统。如果有用户信用“警告:你有信用!数量:[列中的杰顿值]”,如果没有用户信用“警告:你没有信用!”我使用了 MyDAC 组件

杰顿:用户信用列。(在数据库中)

我是怎么做到的?

我试着做

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;

【问题讨论】:

    标签: delphi mydac


    【解决方案1】:

    如果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;
    

    【讨论】:

    • 谢谢,但是,[错误] Unit2.pas(101):未声明的标识符:'AsDouble'
    • 谢谢... :) 任务完成。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-07-16
    • 2010-09-15
    • 2020-09-17
    • 1970-01-01
    • 1970-01-01
    • 2019-09-16
    相关资源
    最近更新 更多