Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Insert Error
Message
From
19/12/2005 02:29:47
 
 
To
19/12/2005 01:45:56
General information
Forum:
Visual FoxPro
Category:
Client/server
Title:
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
MySQL
Miscellaneous
Thread ID:
01079054
Message ID:
01079086
Views:
33
Hi Fabio,

I am actually not sending an append blank. I have just done a small test and am having the same problem. I created a mysql table called salman with two fields

sls_no Integer (Primary Key)
sls_nm Varchar 45

If I create a VFP cursor
lcSQL="select * from salman"
lnSelect=sqlexecute(lnConn,lcSQL,"cuSalman")
Then get it ready for updates
CURSORSETPROP("Tables","salman","cuSalman")
CURSORSETPROP("UpdateName","sls_no salman.sls_no","cuSalman")
CURSORSETPROP("UpdateName","sls_nm salman.sls_nm","cuSalman")
CURSORSETPROP("KeyFieldList","sls_no","cuSalman")
CURSORSETPROP("UpdatableFieldList","sls_no,sls_nm","cuSalman")
CURSORSETPROP("SendUpdates",.t.,"cuSalman")
If I then browse this cursor and add a record like sls_no=50 and sls_nm="Test Salesman", and then committ the record (move off the record), if their isn't a record with sls_no=0, it will committ the new record but change the sls_no to zero (but doesn't display the change to zero in VFP, subsequent queries shows the sls_no as zero). If I then try to add another record like sls_no=100 and sls_nm="Test Salesman Again" I will get an error that I violated the primary key of the table, because VFP is trying to committ sls_no again as zero. If I just enter a new sls_no field I get the error "Cannot insert an empty row from a view or CursorAdapter into base table(s)", although the sls_nm field can accept null values in mySQL.

Can someone see where I am going wrong with this? In VFP6 this just works, I never have any trouble with it. Is their something new in VFP9 that I am failng to address.

Any help appreciated.


Regards
Darren Donald




>>I have an application that was written in VP6, and now that I have VFP9, I want to upgrade to that.
>>
>>I have a remote view, that in VFP6 works fine when I insert a record. But in VFP9 I am getting the error "Cannot insert an empty row from a view or CursorAdapter into its base table(s)".
>>
>>Could anyone please explain what this error is, and why I am getting it in VFP9 but not VFP6?
>>
>>Any help appreciated.
>>
>>Regards
>>Darren Donald
>
>VFP cannot send a APPEND BLANK record ( this is a bug for me )
>
>You can:
>
>APPEND BLANK
>BLANK
>TABLEUPDATE()
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform