Hello,
the script below is enough to connect to db which is defined in ODBC settings:
dbConnect
|kullanici sifre dateTime date aLogonSpec aConnSpec aBlock |
(AbtDbmSystem activeDatabaseConnectionWithAlias: 'HASTANE') isNil
ifFalse: [
(AbtDbmSystem activeDatabaseConnectionWithAlias: 'HASTANE') disconnect
].
"aLogonSpec:=AbtDatabaseLogonSpec id: 'db2admin' password: 'hy36063' server: 'HASTANE' alias: 'HASTANE'."
aLogonSpec:=AbtDatabaseLogonSpec id: 'db2admin' password: 'db2admin' server: 'YES' alias: 'YES'.
aConnSpec := AbtDatabaseConnectionSpec new
dbmClass: AbtIbmCliDatabaseManager;
dsn: 'YES';
promptEnabled: false.
aBlock := Object abtDefaultDatabaseErrorBlock.