Discussion:
Cannot update the cursor blah, since it is read-only.
(too old to reply)
SQLScott
2005-01-13 16:25:03 UTC
Permalink
Using a VB.Net app to connect to a Foxpro database, I get this error when I
issue an Update command against a dbf file directly (meaning, "Update
tablename, set columnname = value")

I have looked at the properties of the dbf file and it is not set as
read-only, and I have also looked for error message in this forum adn did not
find it so I am posting my question.

what am i missing?
--
Thanks,

Scott
Cindy Winegarden
2005-01-14 22:19:49 UTC
Permalink
Hi SQLScott,

Besides using concatenation to create the SQL string you can use a
parameterized query.

Your SQL essentially looks like "UPDATE User SET iporqnxtno = 2" How does
the FoxPro data engine know which record to update? Usually an Update
statement has a Where clause. If so your SQL would look like "UPDATE User
SET iporqnxtno = 2 Where nPrimaryKey = nSomeValue".

Also, this looks like the typical "take a number, increment, and put it
back" method of generating unique key values that is commonly used in VFP
(and other places). However, without some way to lock other users out of the
record while you get your number and then do the update then you can't be
sure your PO numbers will be unique.

Finally, does the web service account have write permissions to the
directory where the data resides?
--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
Post by SQLScott
Using a VB.Net app to connect to a Foxpro database, I get this error when I
issue an Update command against a dbf file directly (meaning, "Update
tablename, set columnname = value")
I have looked at the properties of the dbf file and it is not set as
read-only, and I have also looked for error message in this forum adn did not
find it so I am posting my question.
what am i missing?
--
Thanks,
Scott
Loading...