Mar 15, 2003 Many times I've been with an undeleted file using the VFP DELETE FILE. Mike Gagnon If you want to get the best response to a question, please check out FAQ184-2483 first. FileName specifies the name of a file for the delete operation. The following example uses the OPEN DATABASE command to open the Visual FoxPro sample database.
I can't DELETE records from a Visual FoxPro table which I created in a database. I am able to INSERT and SELECT successfully. The DELETE statement throws no exception, however the data remains. This behavior happens for both the Sun JDBC-ODBC bridge and the ZYH DBF Type 4 driver.
When using the Sun JDBC-ODBC bridge I've tried to execute PACK after the DELETE call and get:
java.sql.SQLException: [Microsoft][ODBC Visual FoxPro Driver]File must be opened exclusively.
So I try 'USE MYTABLE EXCLUSIVE' in a Statement before calling PACK and get:
java.sql.SQLException: [Microsoft][ODBC Visual FoxPro Driver]Syntax error or access violation
I've also tried inserting the USE MYTABLE EXCLUSIVE before calling DELETE but get the same exception above.
The ODBC DSN for MYTABLE is setup as:
- A database (not free tables)
- Null (checked)
- Deleted (checked)
- Fetch data in background (checked)
- I've tried having Exclusive checked and not checked but it seems to make no difference.
OK. Next I download a Type 4 JDBC driver from http://www.hxtt.net/jdbc/. It doesn't like the 'PACK' or 'USE MYTABLE EXCLUSIVE' stuff so I remove those. It doesn't throw any exceptions upon DELETE, however the data remains in the table.
I've tried all of the above with AUTO-COMMIT OFF and AUTO-COMMIT ON.
Don't know what else to try. Ideas????
Environment:
Windows 2000
JDK 1.3.1
Table created in: Visual Foxpro 6.00.8167
Microsoft Visual Foxpro Driver 6.01.8629.01
DBF JDBC 2.0 JAR (Created 2002-09-23)
When using the Sun JDBC-ODBC bridge I've tried to execute PACK after the DELETE call and get:
java.sql.SQLException: [Microsoft][ODBC Visual FoxPro Driver]File must be opened exclusively.
So I try 'USE MYTABLE EXCLUSIVE' in a Statement before calling PACK and get:
java.sql.SQLException: [Microsoft][ODBC Visual FoxPro Driver]Syntax error or access violation
I've also tried inserting the USE MYTABLE EXCLUSIVE before calling DELETE but get the same exception above.
The ODBC DSN for MYTABLE is setup as:
- A database (not free tables)
- Null (checked)
- Deleted (checked)
- Fetch data in background (checked)
- I've tried having Exclusive checked and not checked but it seems to make no difference.
OK. Next I download a Type 4 JDBC driver from http://www.hxtt.net/jdbc/. It doesn't like the 'PACK' or 'USE MYTABLE EXCLUSIVE' stuff so I remove those. It doesn't throw any exceptions upon DELETE, however the data remains in the table.
I've tried all of the above with AUTO-COMMIT OFF and AUTO-COMMIT ON.
Don't know what else to try. Ideas????
Environment:
Windows 2000
JDK 1.3.1
Table created in: Visual Foxpro 6.00.8167
Microsoft Visual Foxpro Driver 6.01.8629.01
DBF JDBC 2.0 JAR (Created 2002-09-23)
Powered by phpBB® Forum Software |