刚接触不久,照书写了一段代码有关ADO连接数据库问题,编译没通过,请帮懂的人帮看看,谢谢 procedure TForm1.BitOpenClick(Sender: TObject);
const
ConnStr = 'Provider=s%;DataProvider=s%;Datasource=s%';//定义书写格式
begin
//ADoconnection1 没有连接的时候建立数据库连接
if not ADOConnectionl.Connected then
ADOConnectionl.ConnectionString:=format(connstr,[provider.text,
DataProvider.Text,edtDataSource.text]);
Try //打开连接
ADOConnectionl.open();
except
Exception.Create(ConopenAdoError); //ConopenAdoError实现定义好的常量出错显示 end;end.编译错误如下:[Error] Unit1.pas(62): Undeclared identifier: 'ADOConnectionl'
--->不太明白,在表单里已经有 ADOConnection1: TADOConnection; 以下更加看不懂 [Error] Unit1.pas(62): 'THEN' expected but identifier 'Connected' found
[Error] Unit1.pas(66): Missing operator or semicolon
[Error] Unit1.pas(68): Undeclared identifier: 'ConopenAdoError'
[Error] Unit1.pas(72): ';' expected but '.' found
[Error] Unit1.pas(74): Declaration expected but end of file found
[Error] Unit1.pas(42): Unsatisfied forward or external declaration: 'TForm1.BitBrowserClick'
[Error] Unit1.pas(43): Unsatisfied forward or external declaration: 'TForm1.BitSaveFileClick'
[Fatal Error] Project2.dpr(5): Could not compile used unit 'Unit1.pas'
const
ConnStr = 'Provider=s%;DataProvider=s%;Datasource=s%';//定义书写格式
begin
//ADoconnection1 没有连接的时候建立数据库连接
if not ADOConnectionl.Connected then
ADOConnectionl.ConnectionString:=format(connstr,[provider.text,
DataProvider.Text,edtDataSource.text]);
Try //打开连接
ADOConnectionl.open();
except
Exception.Create(ConopenAdoError); //ConopenAdoError实现定义好的常量出错显示 end;end.编译错误如下:[Error] Unit1.pas(62): Undeclared identifier: 'ADOConnectionl'
--->不太明白,在表单里已经有 ADOConnection1: TADOConnection; 以下更加看不懂 [Error] Unit1.pas(62): 'THEN' expected but identifier 'Connected' found
[Error] Unit1.pas(66): Missing operator or semicolon
[Error] Unit1.pas(68): Undeclared identifier: 'ConopenAdoError'
[Error] Unit1.pas(72): ';' expected but '.' found
[Error] Unit1.pas(74): Declaration expected but end of file found
[Error] Unit1.pas(42): Unsatisfied forward or external declaration: 'TForm1.BitBrowserClick'
[Error] Unit1.pas(43): Unsatisfied forward or external declaration: 'TForm1.BitSaveFileClick'
[Fatal Error] Project2.dpr(5): Could not compile used unit 'Unit1.pas'
解决方案 »
- 如何在dbgrid中动态加一列按钮?
- 按扭和菜单放到dll 有什么方法和建议?
- 有没有用PowerTCP开发过snmp
- 大家谈一谈技术型创业需要注意哪些地方?言者有分。
- 关于字符串的分解???
- 程序执行后把主窗口隐藏了!(执行后窗口不可见,编码时窗口可见)如何加个Message窗口,再执行后说明程序已经运行?
- 如何控制FORM启动时将所有的combobox itemindex全设为0
- 有关图像校正的问题,请各位高手指点?
- 关于TProgressBar控制。求助。
- delphi调用frFastReport 2.47的报表,如何代码指定打印机自定义纸张?
- 请教sql自动编号的问题
- 如何实时监测SQL SRVER中某表有无数据记录。
const
ConnStr = 'Provider=s%;DataProvider=s%;Datasource=s%';//定义书写格式
begin
//ADoconnection1 没有连接的时候建立数据库连接
if not ADOConnectionl.Connected then
ADOConnectionl.ConnectionString:=format(connstr,[provider.text,
DataProvider.Text,edtDataSource.text]);
Try //打开连接
ADOConnectionl.open();
except
Exception.Create(ConopenAdoError); //ConopenAdoError实现定义好的常量出错显示
end; //至少此处少了个end;
end;
2.是ADOConnection1而不是ADOConnectionl,1 <>L