Koneksi Database tanpa alias - ADOConnection
Tulis code dibawah ini pada
FormCreate
var db:
WideString; begin
db:=ExtractFilePath(Application.ExeName)+'<nama database>.mdb';
with ADOConnection1 do begin
Connected:=False;
LoginPrompt:=False;
Mode:=cmShareDenyNone;
ConnectionString:='Provider=Microsoft.Jet.OLEDB.4.0;Data
Source='+db+';Persist
Security
Info=False'; Connected:=True; end;
end;
Untuk mengaktifkan ADOTable, tuliskan kode dibawah ini :
with ADOTable1 do begin Active:=False;
Connection:=ADOConnection1;
TableName:=’<nama table>’;
No comments:
Post a Comment