Well i'll try to expalin as clear as possible,
I'm using a structure as i told you(the def for the
structure is below). In my code i'm only trying to
store data in SoldToParty
member only(just for testing purposes).
Here's the code for storing the record.
=======================================
frm = FrmGetActiveForm();
fldIndex = FrmGetObjectIndex(frm,
SalesOrderDetailsSoldToPartyField);
fld = FrmGetObjectPtr(frm,fldIndex);
// Get a pointer to the field's text.
text = FldGetTextPtr(fld);
MemHandle myRecord = DmGetRecord(SAPDB,
CurrentRecord);
OrderInfoType *s = MemHandleLock(myRecord);
myStruct = *s;
myStruct.SoldToParty = (Char *)MemPtrNew(20);
StrCopy(myStruct.SoldToParty,text);
DmWrite(s, 0, &myStruct, sizeof(myStruct));
MemHandleUnlock(myRecord);
DmReleaseRecord(SAPDB, CurrentRecord, true);
Here's the code which i have put to retrieve the data
from the struct.
=======================================================
if ((CurrentRecord != noRecordSelected) &&
(DmNumRecords(SAPDB) > 0))
{
recHandle = DmQueryRecord(SAPDB,CurrentRecord);
StructType *pt = MemHandleLock(recHandle);
FldSetText(fld,recHandle,OffsetOf(StructType,SoldToParty),sizeof(pt->SoldToParty));
}
I have followed the MemoPad example's to come this
far. Can you tell me what i have done wrong.
Regards
Dhanushka.
--- Nicolas Raitman <[EMAIL PROTECTED]> wrote:
> Well... what have you done until now? I mean, do you
> have any idea on how
> this works?
>
> -----Mensaje original-----
> De: dhanushka jayakody <[EMAIL PROTECTED]>
> Para: Palm Developer Forum
> <[EMAIL PROTECTED]>
> Fecha: Lunes, 16 de Abril de 2001 03:42 p.m.
> Asunto: Retrieving Records
>
>
> >Hi,
> >
> >I have a problem with Retrieving data from a
> database
> >and assgining the value to a
> >specified form field. the data is stored in a
> >structure.
> >
> >struct
> >{
> > Char *SoldToParty;
> > Char *Address;
> >}OrderInfoType;
> >
> >if i want to retrieve the SoldToParty member, and
> show
> >it on a form field, what
> >are the necessary steps?
> >
> >are there any sample codes for this as well?
> >
> >regards
> >Dhanushka
> >
> >
> >
> >
> >__________________________________________________
> >Do You Yahoo!?
> >Get email at your own domain with Yahoo! Mail.
> >http://personal.mail.yahoo.com/
> >
> >--
> >For information on using the Palm Developer Forums,
> or to unsubscribe,
> please see
> http://www.palmos.com/dev/tech/support/forums/
>
>
> --
> For information on using the Palm Developer Forums,
> or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/