Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table won't update

Status
Not open for further replies.

ongoma

Programmer
Jun 14, 2006
31
KE

Hi Friends,

{VFP6 win98} (I am not on a network)

I have quite a weird scenarion here. I really need help.
I have a table gltranfi.dbf in a database accdbc.dbc.

The app so far has been updating this table without any problems. Now you post an insert and the tableupdate() returns true but a closer look at the table reveals the records were not added.

I have recreated the database from scratch and added the table afresh and even recreated all the keys in it and all the field level validation rules/triggers.

I have checked for the existence of chr(0) in any of the fields in the table. No field has this chr(0) character.

I have copied the records to a text file, recreated my table from scratch and appended from the text file.

This has not made the situation better

*///
If I make the table a free table, the records are added successfully. If I return it to the database the situation reverts to the former state even if I recreate the DBC from scratch.

What could have happened to the table for it to behave this way.

I am at the end of my wit's and this is causing a stir. Please help me out.
 
Ongoma,

A couple of points:

- The fact that TABLEUPDATE() returns .T. doesn't mean anything was actually inserted. It means that no DBC errors or multi-user conflicts were detected.

- You say that everything was working OK before, but now you have this problem. Clearly, something MUST have changed. Either you have changed some code, or there is something new in your environment. If you could think about what has changed, it might tell you why the problem occurs.

- Are you using BEGIN TRANSACTION / END TRANSACTI0N? If so, it could be that the transaction is getting rolled back for some reason. That might possibly explain why the behaviour is different for free tables (which didn't support transactions in VFP 6.0).

If none of the above helps, I suggest you try to do the INSERT from the command window. That will at least tell you if your code is at fault or if the problem lies with the database.

If you can report back with any further information, we can try to crack it.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
ongoma

I had a similar 'not updating' table. I discovered I was in the wrong work area when I issued TABLEUPDATE(). You may try adding the tablename to the command and see if it still returns true, such as
TABLEUPDATE( .f.,.t.,cTableName)

OpticalMan
 

I'll ty your suggestions then I'll revet back to you.

Thanks
 

Hi Friends,

My app used to be with no DBC then much later I incorporated a DBC and validation rules/triggers to the tables.

I set some field validation rules but there were some rows which were not meeting the rules demands. To circumvent this I used NOVALIDATE in my SET CHECK lines.

Is the presence of non-conforming rows in a table a possible cause of 'not updating' scenario.

Currently I have been forced to remove the notorious tables from the DBC at least to keep the shop running without complaints. But I need a complete solution to this funny scenario.

OpticalMan.

I am updating in the correct work area. Thanks
 
You don't say if you are using Views or not. A common problem is that "Send SQL Updates" is not checked on the Update Criteria tab of the View designer.

Craig Berntson
MCSD, Visual FoxPro MVP, Author, CrysDev: A Developer's Guide to Integrating Crystal Reports"
 

Craig Berntson

Am not using views. am just USEing the tables then INSERT INTO ... FROM MEMVAR

Please shed some light. I have been forced to disengage the troublesome tables from the DBC.


Thanks in advance
 
Can you post the exact code you're using to update from the MemVars?

Craig Berntson
MCSD, Visual FoxPro MVP, Author, CrysDev: A Developer's Guide to Integrating Crystal Reports"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top