Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Conexión con bases de datos
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Conexión con bases de datos

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 05-09-2003
tamara tamara is offline
Miembro
 
Registrado: sep 2003
Posts: 12
Poder: 0
tamara Va por buen camino
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;
Responder Con Cita
Respuesta



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 22:31:16.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi