Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Another VFP DLL Question
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00538616
Message ID:
00538667
Vues:
13
>Whats wrong here?
>
>
>** Create an instance of the DLL
>oScProcs = CREATEOBJECT("ScProcs.Procedures")
>WITH oScProcs
>
>  ** Add a new user
>  oRecord = .AddUser()
>
>  ** Fill in the user properties
>  oRecord.RecordId = "00000001"
>  oRecord.FullName = "Joe Person"
>  oRecord.Age = 26
>  oRecord.MarritalStat = 1
>
>  ** Save changes
>  .SaveChanges(oRecord)
>
>ENDWITH
>

>
>The 4 lines with the oRecord are the problem. No matther which of the 4 lines I list first, it's the only
>property that seems to exist on the oRecord object.
>
>In the AddUser method, I have
>SELECT Users
>SCATTER NAME oRecord
>RETURN oRecord
>

>
>So who do I only see one field in the table as a property on the record???

A little warning first:
These don't seem to be causing any problems, but Procedures and Users are both keywords in VFP. I would recommend trying to avoid these (if they really are the names being used...)

Are you getting an error when you access the remaining 3 records, or is the first one the only one you see? When you are viewing an object returned by a COM server, properties will only be revealed as you access them.
I try this and I don't get any errors.

Another thing along those lines: When you pass back oRecord, are you just doing an
APPEND BLANK
GATHER NAME toRecord
If you are, you'll get blank fields on the properties you haven't accessed yet.
e.g.
this gives blank fields
Select users
Append Blank
Gather Name toRecord
this doesn't
Select users
Append Blank
x = toRecord.RecordId
x = toRecord.FullName
x = toRecord.Age
x = toRecord.MarritalStat
Gather Name toRecord
The 2nd version would of course need to be more generic, but you get the idea.
Insanity: Doing the same thing over and over and expecting different results.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform