You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Tim O'Neil <ti...@xythos.com> on 2001/05/08 22:44:48 UTC

Re: Sorry if this is the wrong list but...thought someone might know

At 01:13 PM 5/8/2001 -0700, you wrote:
>I need really simple database access using JSPs in Tomcat under NT.
>
>I am trying to create some tables in a text-based db. I used the ODBC data
>source control panel to creat a ODBC data source as a "System DSN" that is
>text-based (uses Microsoft Text Driver). I use a bean to access it via a JSP
>and when I try to create a table I get the following error in IE:
>
>"Error: SQL error of: [Microsoft][ODBC Text Driver] Cannot modify the design
>of table 'JoltData'. It is in a read-only database. "
>
>Anyone know how I make it writeable?

A couple of ideas spring to mind; first, don't forget that
a text file isn't a real rdbms table, that driver it going
to be missing some of the options that a driver connecting
you to a real rdbms will have. Issue a SQLGetDriverOptions()
(or whatever the call is) after you perform the SQLConnect()
to make sure the driver is capable of what you want it to do.
And what I mean by that is; sure, you should be able to create
a table, yes, but the error you are getting is not consistent
with simply creating a table. It looks more like you're attempting
to add a column to an existing table. You may not be able to do
that with a text driver. (But I don't know, I never have
needed to use a flat text data base.) Just issue the SQLGetDriver
Options(); one of the arguments is the ODBC method you want to
use, and that call will tell you if the driver can do it.

Now another route to consider is maybe taking that data you want
from the old table and adding it to a new table with the columns
you want to add. Or copy the data from the old table into a new
table with no modifications (if you aren't really trying to modify
the existing table.) I'm trying to illustrate that there may be
more than one way to skin your cat.

Lastly, are you sure you have permission to modify the table?
Maybe the file is exactly what the error says, write protected
from you.