Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

java.sql.SQLException: [Microsoft][ODBC Visual FoxPro Driver]Syntax error

843859Sep 30 2006 — edited Oct 3 2006
Hi all,
I am able to INSERT and SELECT records from FoxPRo database successfully.

The driver is Sun JDBC-ODBC bridge

The DELETE statement throws no exception.
I've tried to execute PACK after the DELETE call and got following exception:
java.sql.SQLException: [Microsoft][ODBC Visual FoxPro Driver]File must be opened exclusively.
So I tried
 USE MYTABLE EXCLUSIVE 
in a Statement before calling PACK and got the exception:
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 got the same exception above.

The ODBC DSN for MYTABLE is setup as:
- Free Tables (not database)
- Null (checked)
- Deleted (checked)
- Fetch data in background (checked)

I am not able to issue any of the following commands to FoxPro using java
OPEN - To open a table
CLOSE - To close a table
USE - To open a table for uer either in exclusive mode or shared mode
The exception being generated is :
java.sql.SQLException: [Microsoft][ODBC Visual FoxPro Driver]Syntax error or access violation
The help file of the Microsoft Visual Foxpro Driver states that the driver has support for the above commands.I a not able to get the way to issue the above commands to the driver using java.

In setting up the ODBC DSN I saw no "read only" setting.

In the Visual Foxpro table, I saw no READ ONLY settings.And also, there are no delete permission grants and there is no user database sesssion concept.

I've tried all of the above with DSN mapped to a database(NOT free tables) and setting AUTO-COMMIT OFF and AUTO-COMMIT ON.But in vain. The same exceptions as those stated above persisted.

Environment:
Microsoft Windows XP Professional
JDK version "1.4.2_09"
Microsoft Visual Foxpro 06.00.8167
Microsoft Visual Foxpro Driver 6.01.8629.01

Don't know what else to try.

Can anybody please help me.

Thanks in advance
Archana
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 31 2006
Added on Sep 30 2006
5 comments
438 views