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 25-06-2007
Eolo Eolo is offline
Miembro
 
Registrado: jun 2003
Ubicación: Lanus-Buenos Aires-Argentina
Posts: 29
Poder: 0
Eolo Va por buen camino
Relacionar maestro con detalle

Hola a todos, tengo un servidor remoto que crea un DataSetProvider con un TADODataSet con detalles.

Como hago en los detalles para indicar cual es el TField que hace la relacion con el maestro, ya que lo asigne en la propiedad IndexFieldNames del detalle pero cuando veo el DataSet en el cliente esta propiedad esta vacia?

Desde ya muchas gracias

Responder Con Cita
  #2  
Antiguo 17-10-2007
Avatar de NestorN
NestorN NestorN is offline
Miembro
 
Registrado: ago 2005
Ubicación: Argentina
Posts: 15
Poder: 0
NestorN Va por buen camino
Hola, nunca trabaje con el provider, pero para usar un maestro detalle supongo que debe ser mas o menos iguales casi todos.
Mira en el dataset de detalle definí el index field name, y el masterfields. Asigna el datasourse del maestro y deberia arrancarte.

Suerte
Responder Con Cita
  #3  
Antiguo 17-10-2007
Avatar de karlaoax
karlaoax karlaoax is offline
Miembro
 
Registrado: oct 2003
Ubicación: Monterrey
Posts: 280
Poder: 21
karlaoax Va por buen camino
Mira no soy del area, pero leyendo mucho una vez encontre lo siguiente, y funciona perfectamente , solo espero que andes bien con tu ingles:

Código Delphi [-]
How To Create a Master-Detail Form Using TTable Component

The steps in this How To show how to build a form containing two tables: a master table and a detail table, linked one-to-many. 

Difficulty Level: average      Time Required: 10 minutes 
Here's How: 
1.Start Delphi and select File | New Application... 

2.Select Data Access page on the Component palette. Place two TTable components on a form. Place two TDataSource components on a form. 

3.Select Data Controls page on the Component palette. Place two TDbGrid components on a form. 

4.Set the DatabaseName of the TTable components (Table1 and Table2) to the name of the database to access. Select DBDemos. 

5.Set the TableName property to the name of the table in the database. Select customer.db for the master table: Table1. 

6.Do the same with the child table. Select orders.db for the Table2. 
7.Select the first TDataSource (DataSource1) component and set DataSet property to the name of the table component, that is: Table1. 

8.Do the same with the second TDataSource (DataSource2) component and set DataSet property to the name of the table component, that is: Table2. 

9.Select the first TDbGrid (DBGrid1) component and set the DataSource property to the name of the data source component, i.e. DataSource1. The same for, that is, TDbGrid2.DataSource:=DataSource2. 

10.Set the MasterSource property of the Table2 component to the DataSource1. 

11.Set the IndexFieldName property of the Table2 component to the CustNo. 

12.Click the ellipsis button next to the MasterFields property of the Table2. This will invoke the Field Link Designer. 

13.In the Detail Fields list the select CustNo, in the MasterFields list select CustNo. Click Add. Click Ok. 

14.Set the Active property of both table components to True. 

15.Browse through the records. 


Tips: 
The most important thing in master-detail relationship is the link between the tables. For each record in the master table, the form displays all corresponding records in the detail table. 
Important detail table properties are: IndexFieldNames, MasterFields and MasterSource. For more info look in Delphi Help files.

Los pasos mas importantes son apartir del No. 10.

Espero te sirva.
Atte.
Karla
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

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Problema tabla Maestro-detalle en la q la pk de t.detalle formad por 2cods de la maes akinom38 Varios 1 09-11-2007 19:27:44
Respecto a la relacion maestro detalle detalle ilichhernandez Conexión con bases de datos 0 15-05-2007 18:13:54
Numerar el detalle Maestro / detalle en secuencia josejose SQL 5 10-02-2007 00:27:38
Reporte Maestro/Detalle/Detalle de 4 Tablas jovehe Impresión 2 23-03-2005 01:25:02
Maestro-Detalle ;Actualizar detalle a partir de un DBgrid norberto_larios Conexión con bases de datos 1 11-09-2004 18:17:34


La franja horaria es GMT +2. Ahora son las 09:48:21.


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