 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Plusinfo Guest
|
Posted: Wed Oct 27, 2004 8:27 pm Post subject: Can i create odbc alias using delphi 8 |
|
|
Can i create odbc alias for mssql using code in vcl delphi 8 pro
If i can please tell me how
Thanks
|
|
| Back to top |
|
 |
Jan Doggen Guest
|
Posted: Thu Oct 28, 2004 11:12 am Post subject: Re: Can i create odbc alias using delphi 8 |
|
|
This is from one of our apps.
I didn't write it, so I can't answer questions
Bye
Jan
reg := TRegistry.create;
// Create DSN
reg.RootKey := HKEY_CURRENT_USER;
key := 'Softwareodbcodbc.ini';
If reg.openkey(key, true) then begin
If reg.Openkey('dbIISRap', true) then begin
dbPathname := EdtDatabase.Text;
{ Let op: bij Pathname dient de correcte verwijzing naar de
locatie van de IIS-Rapport.mdb te staan.
Deze locatie dient ook in de Params Properties van
dbIISRap TDatabase te worden ingevoerd }
reg.WriteString('DBQ', dbPathName);
GetSystemDirectory(systemDir, 255);
reg.Writestring('Driver', systemdir + 'odbcjt32.dll');
reg.WriteString('FIL', 'MS Access;');
// Writestring accepteert geen lege string, zodoende rechtstreeks
regSetvalueEx(reg.currentkey, PChar('UID'), 0, REG_SZ, PChar(''), 1);
regSetvalueEx(reg.currentkey, PChar('PWD'), 0, REG_SZ, PChar(''), 1);
reg.WriteInteger('DriverID', 281);
reg.WriteInteger('Safe Transactions', 0);
end;
reg.closeKey;
end;
// Entry toevoegen
Key := 'SoftwareODBCODBC.INIODBC Data Sources';
If Reg.OpenKey(Key, true) then begin
Reg.writestring('dbIISRap', 'Microsoft Access Driver (*.mdb)');
Reg.CloseKey;
end;
Reg.Free;
"Plusinfo" <velaxoutakos (AT) plusinfo (DOT) gr> wrote
| Quote: |
Can i create odbc alias for mssql using code in vcl delphi 8 pro
If i can please tell me how
Thanks
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|