![]() |
![]() |
![]() |
![]() |
![]() |
FTP | ![]() |
![]() |
CCD | ![]() |
![]() |
Buscar | ![]() |
![]() |
Trucos | ![]() |
![]() |
Trabajo | ![]() |
![]() |
Foros | ![]() |
|
Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
![]() |
|
Herramientas | Buscar en Tema | Desplegado |
|
#1
|
|||
|
|||
![]() Que tal
Necesito crear un system dsn en el ODBC al ejecutar un programa en delphi, no se si se pueda hecer esto mediante programacion en delphi. de antemano muchas Gracias.... |
#2
|
||||
|
||||
Te recomiendo buscar información en la web sobre la ODBC API SQLConfigDataSource.
Saludos!
__________________
delphi.com.ar Dedique el tiempo suficiente para formular su pregunta si pretende que alguien dedique su tiempo en contestarla. ![]() |
#3
|
|||
|
|||
Hola VOR.
...marchando truco del almendruco. Lo mejor para crearlo es... ¡que le crees tu mismo a mano! ![]() ![]() ![]() ![]() . . . ![]() ![]() ![]() ![]() . . . Vale, vale. Una vez que hayas creado el DSN, con el RegEdit o editor del registro, ve a la clave HKEY_LOCAL_MACHINE\Software\ODBC\ODBC.INI\ y ahí te aparecerá una clave con toda la información del DSN que hayas creado a mano. Entonces, tu programa lo único que tendrá que hacer es crear todas esas entradas con sus correspondientes valores.
__________________
Una cosa es una cosa, y otra cosa es otra cosa... |
#4
|
|||
|
|||
El otro dia lo hize asi y funciono:
Pones Registry en el uses procedure TForm1.Button1Click(Sender: TObject); var R1:TRegistry; begin R1:=TRegistry.create; R1.RootKey := HKEY_LOCAL_MACHINE; if R1.OpenKey('SOFTWARE\ODBC\ODBC.INI',FALSE) then R1.CreateKey(nombre.Text); R1.Destroy; R1:=TRegistry.create; R1.RootKey := HKEY_LOCAL_MACHINE; if R1.OpenKey('SOFTWARE\ODBC\ODBC.INI\'+nombre.Text,FALSE) then begin R1.WriteString('DBQ',Path.Text); R1.WriteString('Driver',PathDll.Text); R1.WriteInteger('DriverId', 25); R1.WriteString('FIL','MS Access;'); R1.WriteString('PWD',clave.text); R1.WriteInteger('SafeTransactions', 0); R1.WriteString('UID',usr.text); R1.CreateKey('Engines'); R1.Destroy; R1:=TRegistry.create; R1.RootKey := HKEY_LOCAL_MACHINE; if R1.OpenKey('SOFTWARE\ODBC\ODBC.INI\'+nombre.Text+'\Engines',FALSE) then begin R1.CreateKey('Jet'); R1.Destroy; R1:=TRegistry.create; R1.RootKey := HKEY_LOCAL_MACHINE; if R1.OpenKey('SOFTWARE\ODBC\ODBC.INI\'+nombre.Text+'\Engines\Jet',FALSE) then begin R1.WriteString('ImplicitCommitSync',''); R1.WriteInteger('MaxBufferSize', 2048); R1.WriteInteger('PageTimeout', 5); R1.WriteInteger('Threads', 3); R1.WriteString('UserCommitSync','Yes'); R1.Destroy; R1:=TRegistry.create; R1.RootKey := HKEY_LOCAL_MACHINE; if R1.OpenKey('SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources',FALSE) then begin R1.WriteString(nombre.text, driver2.text); R1.Destroy; ShowMessage(' ALIAS CREADO. '); end; end; end; end; end; |
#5
|
|||
|
|||
El otro dia lo hize asi y funciono:
Pones Registry en el uses procedure TForm1.Button1Click(Sender: TObject); var R1:TRegistry; begin R1:=TRegistry.create; R1.RootKey := HKEY_LOCAL_MACHINE; if R1.OpenKey('SOFTWARE\ODBC\ODBC.INI',FALSE) then R1.CreateKey(nombre.Text); R1.Destroy; R1:=TRegistry.create; R1.RootKey := HKEY_LOCAL_MACHINE; if R1.OpenKey('SOFTWARE\ODBC\ODBC.INI\'+nombre.Text,FALSE) then begin R1.WriteString('DBQ',Path.Text); R1.WriteString('Driver',PathDll.Text); R1.WriteInteger('DriverId', 25); R1.WriteString('FIL','MS Access;'); R1.WriteString('PWD',clave.text); R1.WriteInteger('SafeTransactions', 0); R1.WriteString('UID',usr.text); R1.CreateKey('Engines'); R1.Destroy; R1:=TRegistry.create; R1.RootKey := HKEY_LOCAL_MACHINE; if R1.OpenKey('SOFTWARE\ODBC\ODBC.INI\'+nombre.Text+'\Engines',FALSE) then begin R1.CreateKey('Jet'); R1.Destroy; R1:=TRegistry.create; R1.RootKey := HKEY_LOCAL_MACHINE; if R1.OpenKey('SOFTWARE\ODBC\ODBC.INI\'+nombre.Text+'\Engines\Jet',FALSE) then begin R1.WriteString('ImplicitCommitSync',''); R1.WriteInteger('MaxBufferSize', 2048); R1.WriteInteger('PageTimeout', 5); R1.WriteInteger('Threads', 3); R1.WriteString('UserCommitSync','Yes'); R1.Destroy; R1:=TRegistry.create; R1.RootKey := HKEY_LOCAL_MACHINE; if R1.OpenKey('SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources',FALSE) then begin R1.WriteString(nombre.text, driver2.text); R1.Destroy; ShowMessage(' ALIAS CREADO. '); end; end; end; end; end; |
![]() |
|
|
![]() |
|