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

paradox DB in delphi not editable..? 2

Status
Not open for further replies.

d2ned

Programmer
Jun 27, 2003
37
FI
Hey Delphi people,

I'm developing a simple tool for my company which would edit a database from which I can draw data with ASP. Now the asp part is easy, but as I'm pretty new with Delphi I have the following problem which I connot seem to work around:

I had to use a paradox db because my company is using Delphi v.1 (yes, the one from 1995) which cannot use Access databases, obviously - and I'm quite unfamiliar with paradox. So I composed a similiar database using Database Desktop. Now when I try to use DBeditboxes and navigator, they won't let me edit the information in the DB. The "insert" button in the DBnavigator, for example, cannot be pressed and you can't write in the editboxes.

A few years back in school I was using Delphi 4 and access databases and I didn't have this problem. Does anybody know about this problem? Is there possibly a attribute to a paradox db which denies outside access to it? I'm quite out of ideas, so ANY help would be muchos appreciated.

Thanks in advance,
-J
 
If you're using SQL with Paradox, some SELECT options force read-only on the query. It's in the help files I think but shout if you cannot find it (robert.nixon@eds.com).
 
Hi,

actually I'm not using any SQL in my app on the delphi side, I'm using simply the default editboxes and so forth, which I then pointed to a datafield in my datasource. But, I only get data to appear, editing is not possible.

Thanks anyhow,
-J
 
The TQuery component has a RequestLive property. This is set to false by default, presumably on the grounds of performance.

If you set RequestLive to true then you should be able to insert and update records.

I assume that this is correct for Delphi 1. It is correct for later versions.

My experience is that Paradox performs better than Access in Delphi. I have found Paradox to be quite acceptable for small databases.

Andrew
 
I don't understand how your DataSource component is getting the data.

Andrew
 
Hi,

paradox came highly recommended to me also, so I guess you have to start learning someday :)

But, I'm still without an answer, because I'm not using a tquery component. Should I be? I'm doing this all on the basis of a few internet-tutorials that I could find and those Delphi lectures from few years ago. To clear this up: on my form I placed a Tdatasource and a Ttable components to get the data from my drive alias, and that works just fine, my navigator works (with the exception of insert & such) and the editboxes GET data but I cannot write into them. Any further ideas?

Thanks,
-J
 
No you don't need to use a TQuery component. It depends on what you want to do but TTable should be okay.

Is the ReadOnly property of your TTable component set to false?

Andrew
 
Hey,

I think we're getting close! It was "false" and I changed it to "true" and when I tried to change it back to false it errors me with "cannot perform this operation with an open dataset". What does this mean? I searched the delphi help but found only references to dataset properties.. I have a feeling this might be the source of my problem..

-J
 
It sounds as though you are doing something other than a straightforward edit or insert. Can you let us see the relevant code?
 
Well, ReadOnly should be set to False for your TTable.
It should also be set to False for your various DB components such as DBGrid and DBEdit. Can you check them all?


Andrew
 
to dooda: Actually no, I'm trying to be as straightforward as it gets :) I haven't done any hand coding and I just want the user to be able to edit and browse the database as simply as possible, so I have the tdbeditboxes, a tdbmemo, a tdbgrid and a tdbnavigator placed on the form. That's it. Browsing goes like it's supposed to, but now it's complaining that the dataset is open and therefore cannot be set to readonly:false. I just can't find the facts on what an open dataset means so I could fix whatever is wrong!

to andrew: Yes, I checked everything in my app and all readonly properties are false excluding my ttable component which won't let me change it.

-J
 
Set your TTable Active property to false, change your ReadOnly property to False and then set your TTable active property to True.

Andrew
 
That did it!

So the problem was that all this time the readonly property was true, although I was sure I set all of them to false, and it didn't let me change it because it was active, just like andrew figured out. Thank you both very much, you made my day. If you're ever in northern europe, drop a line, I'll buy you beers!

Thanks a lot guys!
-J
 
A beer ... Northern Europe ... hey, I live there. Hampshire, actually.

Andrew
 
ok, now all you got to do is jump on a plane to finland and the pint's yours =D

thanks again!
-J
 
>But, I'm still without an answer, because I'm not using a >tquery component.

Since you are new to Delphi you might like to consider using the following components instead of TTable. Which I find rather restrictive.

TQuery
TQueryUpdate
TDataBase
TSession
TDataSet
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top