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

Table is read only???

Status
Not open for further replies.

beltijs

Programmer
Sep 11, 2003
25
AR
ok, im having this problem:
Database = mysql
Tables = ttable
connection = tdatabase

dbgrid with Tquery i want to update, i have done this with ado tables and querys.
Ok, query says:
"
Select a.id_movimiento, a.id_item, a.id_tamanio, c.descripcion as desc_tamanio, a.id_deposito, a.cantidad_ped, a.cantidad_ent, b.descripcion, a.cantidad_ped-a.cantidad_ent as pendiente
from t0102 a, T0006 b, T0014 c
where id_movimiento = :p_idmovimiento
and a.id_item = b.id_item
and a.id_tamanio = c.id_tamanio
"

Tquery.requestlive = true

When i tried to activate de query i get 'Table is read only'.
I've tried:
- Log in mysql as administrator
- Change de query for a simple one with only one table

Nothing work, any suggestions????

Thanks
 
Have you installed ODBC for MySQL? (you can download it from Do you want use ADO or BDE?

If you use BDE, have you setted your DataBase with BDE administrator?

For BDE try this:

- Put on a form these components: Query, DataSource, DBGrid

- Set Query Property:
--DataBaseName to 'your database declared in BDE Administrator'
-- RequestLive to True
-- SQL: select * from YourTable
-- Active to True

- Set DataSource Property:
-- DataSet to (DoubleClick on it)

- Set DBGrid Property:
-- DataSource to (DoubleClick on it)

Run the program

If you use ADO:
on your project substitute query component with AdoQuery

DoubleClick on AdoQuery.ConnectionString,
click on Built,
click on Microsoft OLEDB Provider for ODBC Drivers,
click Next,
choose your ODBC DNS (that one you created when you have installed ODBC driver for MySql),
click on verify connection. If your connection is established you can link DataSource to adoQuery,
set AdoQuery.active to true.

I hope this can solve
Giovanni Caramia
 
I couldn't make it work, i was reading a lot of posts in some forums, and i found out i have to use tupdatesql to execute diferents action over the data returned by the sql. But it didn't work. Otherwise i realise that de performance was very poor. So i decide to use a msqldac component. I didn't want to use it because i prefer not to tie my application to a database server component, but i can´t spend more time trying to make this work property.

Thanks again,

Paula

 
I use dbExpress to access MySQL databases. It is very fast.

If you need to populate a TDBGrid then you need to have a TClientDataset and a TDatasetProvider component as well.

Have a look at the FAQs on dbExpress.

Andrew
Hampshire, UK
 
IIRC, normally, you can do a RequestLive if the query contains fields from more than one table. This is because the bde doesn't know which table you're trying to update.

Looking at your query, you might be able get it to work by setting up two queries - one that pulls the data from tablea and one that's a lookup into tableb. You would then set up the a.id_item TField as a Lookup that uses tableb.

-Dell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top