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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to update record using Pervasive SQL?

Status
Not open for further replies.

ozero

Programmer
May 21, 2005
5
HK
I have installed the Pervasive SQL 8.6 trial and success
to setup it and connect to my Peachtree data, which mean
using select statement in browseing is OK. But I have
problems when I try to update record with where statement.

For example I am success to update the Chart table by using :
"update Chart set LastYrPer12Net = 200"
It updated all the field in Chart which mean the data is
not read only.

However, when I run follow SQL which generated by SQL Data
Manager :
"update Chart set LastYrPer12Net = 200 where AccountID = '10000'"
or
"UPDATE "Chart" SET "Chart"."LastYrPer11Net" = 200 WHERE ("Chart"."AccountID"='10000')"

It have follow error :
ODBC Error
ODBC Error: SQLSTATE = S1000, Native error code = -4953
Access to the requested file is denied(Btrieve Error 46)

It is strange that I able to select record by
"Select LastYrPer12Net from Chart where AccountID = '10000'"
but fail to update with where statement.

Anyone can give me a hint how to solve it?

Thanks in advance !
 
A status 46 can mean a few things. It can mean:
- The file is marked or opened Read Only
- The file has an owner name.
- The file is open by another engine and the V8.6 engine opened it read only.
- If you were using PSQL v9, it could also mean that you are trying to write to a Btrieve v5.x format file.

I've not worked with Peachtree so I can't say which it might be. You'll want to make sure the data file(s)and the DDFs aren't marked Read Only. Then you'll need to make sure another engine isn't opening the files (exit Peachtree or any other program that uses Btrieve/Pervasive and try again). And last, you'll want to ask Peachtree if they put an owner name on the files.



Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
Custom VB and Btrieve development.
 
Thx Mirtheil

I am sure the data file is not read only, since I can update the record without conditional update

I am sure Peachtree is not running, otherwise I cannot update the record in Peachtree and I only running the Pervasive v8.6 Data Service Manager for Workgroup Engine

But still fail to update with conditional update statement T_T
 
I've never seen that type of behavior. You might run a database consistency check on the database to see if there's something with the database that's causing the problem.

Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
Custom VB and Btrieve development.
 
I believe Peachtree files use owner names. These allow viewing but unless you know the password you cannot update the files outside of there software.



Gil
 
Thx Gil, I got what you mean. But how could I know the
owner name?

I am using the example of Peachw8, PCS. Also how could I
know the owner know if I ceate a new company?

Thanks a lot!
Ozero
 
Best Software owns Peachtree. They are the only ones that would know that name unless they provide that out to other developers or users. I doubt they will provide it but you could contact them and see.


Gil
 
T_T~ Then there is no method to update Peachtree's DDE outside
Peachtree? I also tried using VB sample which provided by
Peachtree support site to update DDE, but when I modified the
field and execute ".poke" to process, it have error occur...

Anyone know how to update Peachtree outside of it?

Millions Thx
Ozero
 
I'm having the very same problem. I need to update the PhaseID field in the JrnlRow.dat file. If I do a general update it works fine, but if I try a conditional update I get the error 46. I'd really appreciate any help on this one as the issue is becoming more urgent with time.

Thanks in advance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top