CodePudding user response:
Database attributes and input the Database path and Database file name, also need the Query and the DataSourceCodePudding user response:
Usage and ADOCodePudding user response:
I made a simple encapsulation layer, with ado about, as follows:Type
TSMDBParam=record
DbType: TDbType;
Server: string;
Account: a string;
Password: string;
DbName: string;
Port: integer;
end;
The function TSMUniDriver. Conntect () : a Boolean;
The begin
Disconnect ();
Case FDBParam. DbType of
DtMySQL: FConnection. ProviderName:='MySQL';
DtMSSQL: FConnection. ProviderName:='SQL Server;
DtSqlite: FConnection. ProviderName:='SQLite;
end;
FConnection. SpecificOptions. Values: [' UseUnicode]='true';
FConnection. SpecificOptions. Values: [' Direct ']='false';
FConnection. Username:=FDBParam. Account;
FConnection. Password:=FDBParam. Password;
FConnection. Database:=FDBParam. DbName;
FConnection. Server:=FDBParam. Server;
FConnection. Port:=FDBParam. Port;
Try
FConnection. Connect;
Result:=FConnection. Connected;
Except,
Result:=false;
end;
end;
CodePudding user response:
The original poster is the use of the "pool", the answer is how to connectCodePudding user response:
Attention,,,,