Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
More ADO fun and errors
Message
De
02/01/2001 16:29:48
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Titre:
More ADO fun and errors
Divers
Thread ID:
00458651
Message ID:
00458651
Vues:
45
1st, thanks to those who have helped me get this far...

I have a set of custom wrapper classes in VFP 6 for ADO data access to SQL Server 7.0 data on a LAN

The ADO connection is working, and I have wrapped a custom class around an ADO recordset for a table, having properties in the class that correspond to the fields. I bound the class properties to text boxes on a form and set up navigation controls. This all seems great. Now for the fun part:

If I make changes to the object programmatically, then those changes will save to the table fine when I call the recordset Update method. However if the changes are made interactively (through being bound to a text box, for example), then the update method gives an error: "Multiple step OLE DB operation generated errors. Check each OLE DB status value if available. No work was done."

example code for update method of class Client:
>>>>>>>>>>>>>>>>>>>>>>>
this.myrecordset.Fields("active").Value = this.active
this.myrecordset.Fields("contactinfoid").Value = this.contactinfoid
this.myrecordset.Fields("defaultbillamount").Value = this.defaultbillamount
this.myrecordset.Fields("defaultglbill").Value = this.defaultglbill
this.myrecordset.Fields("defaultglpay").Value = this.defaultglpay
this.myrecordset.Fields("defaultserviceid").Value = this.defaultserviceid
this.myrecordset.Fields("name").Value = this.clientname
this.myrecordset.Fields("processtypeid").Value = this.processtypeid
this.myrecordset.Fields("shortname").Value = this.shortname
this.myrecordset.Fields("website").Value = this.website
this.myrecordset.Update()
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

The error occurs when it hits a line containing a changed field. For example, if you had changed the shortname field in the textbox bound to it. In contrast,
code like :
********
thisform.client1.shortname = 'JIM'
thisform.client1.update()
*********
will work okay.

The text box on the form has datasource = thisform.client1.shortname

Tracing this though the debugger shows the value of client1.shortname as being no different interactively vs. programmatically. (both = 'JIM'), but in the interactive case, you get the above mentioned error.

This is pretty strange to me, so any ideas would be helpful.
Jim Newsom
IT Director, ICG Inc.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform