Página 1 de 1

Seleccionar Area de trabajo

Publicado: Sab Feb 19, 2005 9:53 pm
por carlos
Estoy metido en un rollo a la hora de Seleccionar un area
Alguien me ayuda???
Hao esto!!!
If ::oDbfDS2:ForcedSeek(alltrim(::oEditUser:Value))
oValor := alltrim(::oDbfDS2:FieldGetByName("IDPERSONA"))
::oDbfDS1:Select("PERSONAS"),,,, ËSTO NO ME TRABAJA
If ::oDbfDS2:ForcedSeek(oValor)
:cText := alltrim(::oDbfDS1:FieldGetByName("Nombre")) +"
"+Alltrim(::oDbfDS1:FieldGetByName("Apellido1"))
Else
:cText := alltrim(::oDbfDS2:FieldGetByName("Nombre"))
EndIf
Else
:cText := "No hay Usuario"
If MsgYesNo("Este usuario no Existe en la Tabla ,,
REPITA","Error de Logeo", RTF_VER )
::oEditUser:Value := space(11)
::oEditUser:SetFocus()
EndIf
EndIf
ENTONES LA RELACIONES TAMPOCO ME TRABAJAN,, QUIERO POR FAVOR QUE ME ENVIEN
UNA MUESTRA DE COMO RELACIONAR LAS TABLAS Y COMO SELECCIONAR LA AREAS DE
TRABAJO
gRACIAS

Seleccionar Area de trabajo

Publicado: Dom Feb 20, 2005 5:26 pm
por ignacio
Carlos,
> If ::oDbfDS2:ForcedSeek(alltrim(::oEditUser:Value))
El IF es absurdo ya que ForcedSeek nunca devuelva nada distinto de .T. ya
que en dicho caso genera un error de ejecución.
Puede sustituir esto:
oValor := alltrim(::oDbfDS2:FieldGetByName("IDPERSONA"))
Por esto si lo desea:
oValor := alltrim(::oDbfDS2:IDPERSONA)
> ::oDbfDS1:Select("PERSONAS"),,,, ËSTO NO ME TRABAJA
Necesita unos conocimientos mínimos de SQL, pruebe con:
::oDbfDS1:Select("SELECT * FROM PERSONAS"),,,,
Para establecer relaciones y seleccionar cualquier área de trabajo puede
utilizar los comandos básicos de Clipper (xHarbour). No obstante la clase
TDbfDataSet tiene métodos equivalenetes para hacer ese mismo tipo de
operaciones:
//---------------------------------------------------------- --------------//
METHOD Select()
Selecciona el área del DbfDataSet
RETURN NIL
//---------------------------------------------------------- --------------//
METHOD Alias()
Devuelve el Alias del Dataset
RETURN cAlias
//---------------------------------------------------------- --------------//
METHOD SetRelation( cField, oDataSet, lAdd )
cField: Nombre del campo sobre el cual se establece la relación
oDataSet: Objeto TDataSet a relacional
lAdd: Si verdader se mantendrán las relaciones existentes. Por defecto .T.
Establece una relación entre un campo del actual DataSet y otro DataSet
RETURN NIL
//---------------------------------------------------------- --------------//
METHOD ClearRelations()
Borra todas las relacioens del actual TDataSet
RETURN NIL
Saludos
--
Ignacio Ortiz
www.xailer.com
"Carlos Cedeño Vera" <carlos@labodegadeclimas.com> escribió en el mensaje
news:4217a767$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
> Estoy metido en un rollo a la hora de Seleccionar un area
> Alguien me ayuda???
>
> Hao esto!!!
>
> If ::oDbfDS2:ForcedSeek(alltrim(::oEditUser:Value))
> ::oDbfDS1:Select("PERSONAS"),,,, ËSTO NO ME TRABAJA
> If ::oDbfDS2:ForcedSeek(oValor)
> :cText := alltrim(::oDbfDS1:FieldGetByName("Nombre")) +"
> "+Alltrim(::oDbfDS1:FieldGetByName("Apellido1"))
> Else
> :cText := alltrim(::oDbfDS2:FieldGetByName("Nombre"))
> EndIf
> Else
> :cText := "No hay Usuario"
> If MsgYesNo("Este usuario no Existe en la Tabla ,,
> REPITA","Error de Logeo", RTF_VER )
> ::oEditUser:Value := space(11)
> ::oEditUser:SetFocus()
> EndIf
> EndIf
>
> ENTONES LA RELACIONES TAMPOCO ME TRABAJAN,, QUIERO POR FAVOR QUE ME ENVIEN
> UNA MUESTRA DE COMO RELACIONAR LAS TABLAS Y COMO SELECCIONAR LA AREAS DE
> TRABAJO
>
> gRACIAS
>
>