加个try
try
if edit1.Text='' then
adoconnection1.ConnectionString:='Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Catalog=master;Data Source=ZZQ\ZZQSQLSERVER'
else
adoconnection1.ConnectionString:='Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;'+'password='+edit1.Text+';Catalog=master;Data Source=ZZQ\ZZQSQLSERVER' ;
adoconnection1.open;except
application.message('密码输入有问题','报错',mb_ok);
end;
if adoconnection1.Connected=true then
begin
form1.show;
form4.hide;
end
else
begin
messagebox(handle,'connecting over time','error',mb_ok)
end;
end;
try
if edit1.Text='' then
adoconnection1.ConnectionString:='Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Catalog=master;Data Source=ZZQ\ZZQSQLSERVER'
else
adoconnection1.ConnectionString:='Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;'+'password='+edit1.Text+';Catalog=master;Data Source=ZZQ\ZZQSQLSERVER' ;
adoconnection1.open;except
application.message('密码输入有问题','报错',mb_ok);
end;
if adoconnection1.Connected=true then
begin
form1.show;
form4.hide;
end
else
begin
messagebox(handle,'connecting over time','error',mb_ok)
end;
end;
解决方案 »
- 截屏了,如何设置保存图片的大小,现在有5M多,我最好80K左右就行了
- 一个关于DBGrid的问题
- 求教:查看电脑上程序自启动问题及查看进程相关问题
- 生成dbf文件时,出现乱码
- JSP系统和IntraWeb子系统的用户信息的兼容问题
- 运行BDE administrator 出错
- 关于数组的问题!(对C,Pascal熟悉的请进!高手请进!UP有分) :)
- delphi6怎么不知道null这个变量?
- delphi中采用三层结构,服务器端执行的全是客户端动态提交的,没有固定的参数,我怎么调用存储过程并在客户端得到存储过程返回的传出参数
- 关于扫描件中二维码的生成和识别
- delphi的打印的小问题
- combobox的问题
当输入的不正确的时候
到adoconnection1.open这句话的时候还是会错