Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Update a table in a database with a view
Message
From
05/06/2007 05:13:49
 
 
To
05/06/2007 04:42:41
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01230467
Message ID:
01230484
Views:
28
>This is my code that doesn't work, maybe you can see the mistake?

well, IMHO one mistake is, that you didn't specify the table where the updates have to go.
So you will need at least this line:
DBSetProp("view5","View","Tables","mydbc!mytable")
Another point is the missing UpdateNames for the updatable fields:
DBSetProp("view5.myfieldname","Field","UpdateName","mydbc!mytable.myfieldname")
>CREATE SQL VIEW view5 AS SELECT &m_selectvelden FROM ALLTRIM(m_dbf2) WHERE SUBSTR(postcode, 1, 2) = >ThisForm.cmbpostcode.DisplayValue

I also would recommend not to use an expression like "...alltrim(m_dbf2)..." in the FROM clause and not using an object reference like "thisform.cmbpostcode.displayvalue" within the SQL statement. But this shouldn't be related to your actual problem.
Holger Vorberg
Germany
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform