Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Updating Data from the Web
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Titre:
Updating Data from the Web
Divers
Thread ID:
00544742
Message ID:
00544742
Vues:
42
Hi,

I've created a business object called "person". I've built it as an OLEPUBLIC class. In VFP from the command window, I can instantiate the COM object, retrieve a record as an ADO recordset, and update one or more fields. When I save, the update goes through as expected. I'm using all standard MMF methods.

My problem is that I can't do the same from an ASP page. From the ASP page I can instantiate the COM object, retrieve a record, and display the data. The problem occurs when I update a field in the ADO recordset, send the recordset back to the business object, then call the Save() method. I don't get any errors, but the field in the table never gets changed. Here's my sample code:

var oPerson = Server.createobject('odsweb.person');

// Set data format as ADO.
oPerson.SetDataFormat(1);

// Retrieve record
oPerson.GetPerson(2);

// Retrieve the ADO recordset.
var rs = oPerson.GetDataX()

// Update a field. Original value is 'George'
rs.Fields('first').Value = 'Georgie Porgie';

// Send the recordset back to business object.
oPerson.SetDataX(rs);

// Save the changes.
oPerson.Save();

Any suggestions would be greatly appreciated. Thanks --Tom
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform