Arsip: mengakses database access berpassword
more 18 years ago
gito
mas2 gimana mengakses database access berpassword pk adoconnectionstring, jd pas dirun dah ga minta2 password lagi. thanks
more 18 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 18 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 5 years ago - PascalTalk #5: UX: Research, Design and Engineer
by LuriDarmawan in Tutorial & Community Project more 5 years ago - PascalTalk #4: Obrolan Ringan Seputar IT
by LuriDarmawan in Tutorial & Community Project more 5 years ago - PascalTalk #2: Membuat Sendiri SMART HOME
by LuriDarmawan in Tutorial & Community Project more 5 years ago - PascalTalk #3: RADically Fast and Easy Mobile Apps Development with Delphi
by LuriDarmawan in Tutorial & Community Project more 5 years ago - PascalTalk #1: Pemanfaatan Artificial Intelligence di Masa Covid-19
by LuriDarmawan in Tutorial & Community Project more 5 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 13 years ago - [ask] koneksi ke ODBC user Dsn saat runtime dengan ado
by halimanh in FireBird more 13 years ago - Validasi menggunakan data tanggal
by mas_kofa in Hal umum tentang Pascal Indonesia more 13 years ago
Random Topic
- format 4digit
by dinox in Tip n Trik Pemrograman more 19 years ago - timeArt 1.0 [final release]
by portege in OpenSource dan Gratis more 18 years ago - pletak pletuk mysqLL
by nurez in MySQL more 20 years ago - Delphi 2007 for PHP
by juan81 in Delphi.NET more 18 years ago - Blocks World Architecture
by sedotin in Tutorial & Community Project more 17 years ago - cara membuat install package software sendiri
by m3llo in Tip n Trik Pemrograman more 18 years ago - Program Login Complete
by ilhuna in Lain-lain more 14 years ago - Tanya: Cara kerja dbImage di Quick Report
by cintik in Hal umum tentang Pascal Indonesia more 19 years ago - Jumlah record maksimal MySQL
by goehsatrio in MySQL more 17 years ago - where item_id in (:parameter)
by mas_kofa in MySQL more 17 years ago