Arsip: mengakses database access berpassword

more 17 years ago
gito
mas2 gimana mengakses database access berpassword pk adoconnectionstring, jd pas dirun dah ga minta2 password lagi. thanks

more 17 years ago
mas_kofa
1. user name ama password diset saat perancangan melalui property connecting string.
2. property connected diset true
3. dan property login prompt diset false

more 17 years ago
tomboati
type
TDBType = (dbtSQLServer, dbtMDB, dbDBF);
public
function ConnectDB(const FileName : TFileName; const DBType : TDBType; pwd : string = ''):boolean;
bla bla.........
function TDM.ConnectDB(const FileName: TFileName; const DBType : TDBType; pwd : string = ''): boolean;
var
DBName : widestring;
SQLConnection : TSQLConnection;
begin
Result := False;
if DBType = dbtMDB then
begin
AdoConn.ConnectionString:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source=' + FileName + ';Persist Security Info=False';
if pwd <> '' then AdoConn.ConnectionString:=AdoConn.ConnectionString + ';Jet OLEDB:Database Password=' + pwd;
DBName := FileName;
end;
AdoConn.LoginPrompt := False;
result:=True;
MainForm.ConnectedTO := DBName;
try
if NOT AdoConn.Connected then AdoConn.Open;
Result:=True;
except
ON E:Exception do
begin
MessageDlg(e.Message,mtError, [mbOK],0);
MainForm.ConnectedTO := '';
pwd := InputBox('MDB with password','If this is password protected, please enter password (leave empty to cancel):','');
if pwd = '' then
begin
Result := false;
Exit;
end
else
if ConnectDB(FileName, DBType, pwd) then Result := True;
end;
end;
end; (ConnectDB )
Semoga membantu,
http://tao.esaprima.commore ...
- Pages:
- 1
reply |
Report Obsolete
AI Forward

🚀 We're thrilled to partner with Alibaba Cloud for "AI Forward - Alibaba Cloud Global Developer Summit 2025" in Jakarta! Join us and explore the future of AI. Register now:
https://int.alibabacloud.com/m/1000400772/
#AlibabaCloud #DeveloperSummit #Jakarta #AIFORWARD
Last Articles
Last Topic
- PascalTalk #6: (Podcast) Kuliah IT di luar negeri, susah gak sih?
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #5: UX: Research, Design and Engineer
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #4: Obrolan Ringan Seputar IT
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #2: Membuat Sendiri SMART HOME
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #3: RADically Fast and Easy Mobile Apps Development with Delphi
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #1: Pemanfaatan Artificial Intelligence di Masa Covid-19
by LuriDarmawan in Tutorial & Community Project more 4 years ago - Tempat Latihan Posting
by LuriDarmawan in OOT more 5 years ago - Archive
- Looping lagi...
by idhiel in Hal umum tentang Pascal Indonesia more 12 years ago - [ask] koneksi ke ODBC user Dsn saat runtime dengan ado
by halimanh in FireBird more 12 years ago - Validasi menggunakan data tanggal
by mas_kofa in Hal umum tentang Pascal Indonesia more 12 years ago
Random Topic
- [Tanya] Worklist Teamwork
by eksant in OOT more 17 years ago - Program yang bisa diupdate
by Fransisca_cicilia in Hal umum tentang Pascal Indonesia more 15 years ago - Class generator
by saysansay in Tip n Trik Pemrograman more 19 years ago - mohon perhatiannya sebentar
by shadri in OOT more 17 years ago - Tanya tenteng Copy String
by krishy in Tip n Trik Pemrograman more 18 years ago - bagaimana cara mengecek client masih terhubung atau tidak ?
by stoopid in Tip n Trik Pemrograman more 18 years ago - Ranking Buat Raport
by asiyrob in Paradox more 16 years ago - [Ask]dbGrid dgn Background image
by kabuki_enemy in Tip n Trik Pemrograman more 16 years ago - Three-Layered Application buat Delphi
by qlunk in Enginering more 13 years ago - *.dcu
by nurez in Tip n Trik Pemrograman more 18 years ago