var
servername,username,password:string;
begin
database1.close;
database1.Params[1]:='user name='+username;
database1.Params[2]:='password='+password;
database1.connected:=true;
end;
还有一点:所有和此database连上的诸如table,query等,最好在使用之前有以下几句:
eg:
query1.close;
query1.database:=database1;
......
query1.open;