c++builder吧 关注:704贴子:3,313
  • 4回复贴,共1

大神在哪,求看哪里出错了,新手

只看楼主收藏回复

Form1
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
#include "Unit2.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
ADOQuery1->SQL->Clear();
ADOQuery1->SQL->Add("select * from Manager ");
ADOQuery1->SQL->Add("where Mname='"+Edit1->Text+"' and PW='"+Edit2->Text+"'");
if(ADOQuery1->ExecSQL())
{
ShowMessage("登陆成功");
Form2->Show();
}
else
{
ShowMessage("用户名或密码错误!");
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
Close();
}
//---------------------------------------------------------------------------


IP属地:广东1楼2016-01-07 19:51回复
    [C++ Error] Unit1.cpp(18): E2316 '_fastcall TForm1::Button1Click(TObject *)' is not a member of 'TForm1'


    IP属地:广东2楼2016-01-07 19:51
    收起回复
      你没有拖用buttom控件


      IP属地:贵州来自Android客户端4楼2016-01-09 19:05
      回复