Question

I'm using a Win XP box with BDE Administrator and Access 2007 installed. I'm able to open and perform select queries on existing Paradox tables without problem but have some very strange behavior when attempting INSERT/UPDATE. I can even create a new Paradox table and it has the same behavior. Here is sample code:

 ' create new table
conObj.Execute "CREATE TABLE test (id INT, comment VARCHAR(30))"

' first insert works fine
conObj.Execute "INSERT INTO test VALUES (1, 'something')"

' second insert fails for unknown reason
conObj.Execute "INSERT INTO test VALUES (2, 'something else')"

I've tried using Jet 4.0, MS Access Paradox driver, and native Paradox driver connection strings but all yield the same result. On the second insert statement it throws an error:

Operation must be an updateable query

I've read numerous posts in forums and pages on help sites that tell me this error is caused by a file permissions issue. The account running this script is part of the Administrator group and I've changed file permissions to allow the Everyone group Full Control of the db file but this changes nothing.

This page put out by Micrsoft Support did not fix the problem: http://support.microsoft.com/kb/175168

Additionally, I can create a new table but any time I try to create a PRIMARY KEY or UNIQUE field I get an error message that says:

"Index_[random characters] is not a valid name."

Was it helpful?

Solution 2

I don't know much about Paradox databases but this has indeed been a learning experience. Even though I have a table file called table.db that's not enough to store more than a single row of data. I also need several other files to insert or update a paradox database:

table.DB
table.PX
table.VAL
table.XG0
table.XG1
table.YG0
table.YG1

I was nosing around in another program that generates paradox databases and found when I copied a blank database from it along with these other files it generated I was able to insert and update without problems. I have no idea what these files are for or why they need to be present to insert or update but having them present fixed my issue.

OTHER TIPS

try "CREATE TABLE test (id INT, comment VARCHAR(30), primary key(id))"

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top