delphi 7:undeclared identifier
unitUnit1;interfaceusesWindows,Messages,SysUtils,Variants,Classes,Graphics,Controls,F...
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Menus,Inifiles, DB, ADODB, DBTables, ComCtrls;
type
Tmainform = class(TForm)
MainMenu1: TMainMenu;
N1: TMenuItem;
N2: TMenuItem;
N3: TMenuItem;
ADOConnection1: TADOConnection;
StatusBar1: TStatusBar;
N4: TMenuItem;
N5: TMenuItem;
N6: TMenuItem;
N7: TMenuItem;
N8: TMenuItem;
N9: TMenuItem;
procedure FormCreat(Sender: TObject);
procedure N9Click(Sender: TObject);
procedure N4Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
mainform: Tmainform;
vlogin:string;
vloginname:string;
Vloginstatus:string;
myinifile:Tinifile;
f_student:Tf_student; ////错误行 /////////////////
implementation
uses Unit2; /////错误行///////////
{$R *.dfm}
procedure Tmainform.FormCreat(Sender: TObject);
var
filename:string;
begin
filename:=ExtractFilePath(paramstr(0))+'dblink.ini';
myinifile:=Tinifile.create(filename);
try
adoconnection1.Connected:=false;
adoconnection1.LoginPrompt:= False;
adoconnection1.Connected:=true;
except
showmessage('数据库连接失败,请检查dblink.ini文件中的连接信息的设置是否正确!');
application.Terminate;
end;
end;
procedure Tmainform.N9Click(Sender: TObject);
begin
if MessageDlg('是否确定要离开系统?',
mtConfirmation,[mbYes,mbNo],0)=mrYes then
application.Terminate;
end;
procedure Tmainform.N4Click(Sender: TObject);
var I: integer;
//f_student:Tf_student;
begin
with mainform do
for I:=MDIChildCount-1 downto 0 do
MDIChildren[I].Close;
F_student:=TF_student.Creat(self);
F_student.Show;
end;
end.
错误提示:
[error]unit1.pas(39):Undeclared identifier:'Tf_student'
[Fatal error]unit1.pas(44):Could not compile used unit 'Unit2.pass'
请问这是什么原因啊? 展开
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Menus,Inifiles, DB, ADODB, DBTables, ComCtrls;
type
Tmainform = class(TForm)
MainMenu1: TMainMenu;
N1: TMenuItem;
N2: TMenuItem;
N3: TMenuItem;
ADOConnection1: TADOConnection;
StatusBar1: TStatusBar;
N4: TMenuItem;
N5: TMenuItem;
N6: TMenuItem;
N7: TMenuItem;
N8: TMenuItem;
N9: TMenuItem;
procedure FormCreat(Sender: TObject);
procedure N9Click(Sender: TObject);
procedure N4Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
mainform: Tmainform;
vlogin:string;
vloginname:string;
Vloginstatus:string;
myinifile:Tinifile;
f_student:Tf_student; ////错误行 /////////////////
implementation
uses Unit2; /////错误行///////////
{$R *.dfm}
procedure Tmainform.FormCreat(Sender: TObject);
var
filename:string;
begin
filename:=ExtractFilePath(paramstr(0))+'dblink.ini';
myinifile:=Tinifile.create(filename);
try
adoconnection1.Connected:=false;
adoconnection1.LoginPrompt:= False;
adoconnection1.Connected:=true;
except
showmessage('数据库连接失败,请检查dblink.ini文件中的连接信息的设置是否正确!');
application.Terminate;
end;
end;
procedure Tmainform.N9Click(Sender: TObject);
begin
if MessageDlg('是否确定要离开系统?',
mtConfirmation,[mbYes,mbNo],0)=mrYes then
application.Terminate;
end;
procedure Tmainform.N4Click(Sender: TObject);
var I: integer;
//f_student:Tf_student;
begin
with mainform do
for I:=MDIChildCount-1 downto 0 do
MDIChildren[I].Close;
F_student:=TF_student.Creat(self);
F_student.Show;
end;
end.
错误提示:
[error]unit1.pas(39):Undeclared identifier:'Tf_student'
[Fatal error]unit1.pas(44):Could not compile used unit 'Unit2.pass'
请问这是什么原因啊? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询