level 7
想实现一个可以切换与数据库连接与关闭的功能,出现如下问题:
con1.ConnectionString:=edt1.Text;
if con1.Connected=True then//这行第二次执行时报错了,显示错误为 对象打开时,不允许操作
begin
con1.Connected:=False;
end
else
begin
tbl1.TableName:='users';
tbl1.Open;
con1.Connected:=True;
end;
求抱腿!
2015年01月05日 16点01分
1
con1.ConnectionString:=edt1.Text;
if con1.Connected=True then//这行第二次执行时报错了,显示错误为 对象打开时,不允许操作
begin
con1.Connected:=False;
end
else
begin
tbl1.TableName:='users';
tbl1.Open;
con1.Connected:=True;
end;
求抱腿!