Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Problem with delphi 5 MyOdbc remote database write (privilage?)

Greg_xGreg_x Member Posts: 6
Hi !
I am new in SQL programming, I have a problem:
(Note: I can read/write a local paradox table in Delphi, I can read a Mysql table from Delphi, and I can read/write a MySQL database From PHP These are on same PC), I want to insert a new record (with MySQL ODBC) into a MySql Table, but the system message is: Table not open for insert or append...
query1.clear,close..
query1.add (select * from table)
query1.RequestLive:= true;
query1.open
query1.append
I think my user(root) has all privilages.
Plz Help Me!!!!

Comments

  • PerranPerran Member Posts: 241
    : Hi !
    : I am new in SQL programming, I have a problem:
    : (Note: I can read/write a local paradox table in Delphi, I can read a Mysql table from Delphi, and I can read/write a MySQL database From PHP These are on same PC), I want to insert a new record (with MySQL ODBC) into a MySql Table, but the system message is: Table not open for insert or append...
    : query1.clear,close..
    : query1.add (select * from table)
    : query1.RequestLive:= true;
    : query1.open
    : query1.append
    : I think my user(root) has all privilages.
    : Plz Help Me!!!!
    :
    If what you're wanting to do here is select records from a table and add them to another, that's usually done like:
    [code]
    INSERT INTO MyTable SELECT * FROM MyOtherTable.....
    [/code]
    In Delphi, use "open" only to return a result set [select]. Use the "ExecSQL" command for "insert", "delete" and ccmmands that don't return a result. Look for your localSQL help file. They put it in a weird place like in with the BDE or Database Desktop. I'd also recommend using straight SQL rather than Borland commands if you want your app to scale. It might be too late, but I'd recommend TMyDB from http://www.kylix.dubaron.com/ It's free and no licensing fees to worry about.
  • Greg_xGreg_x Member Posts: 6
    : : Hi !
    : : I am new in SQL programming, I have a problem:
    : : (Note: I can read/write a local paradox table in Delphi, I can read a Mysql table from Delphi, and I can read/write a MySQL database From PHP These are on same PC), I want to insert a new record (with MySQL ODBC) into a MySql Table, but the system message is: Table not open for insert or append...
    : : query1.clear,close..
    : : query1.add (select * from table)
    : : query1.RequestLive:= true;
    : : query1.open
    : : query1.append
    : : I think my user(root) has all privilages.
    : : Plz Help Me!!!!
    : :
    : If what you're wanting to do here is select records from a table and add them to another, that's usually done like:
    : [code]
    : INSERT INTO MyTable SELECT * FROM MyOtherTable.....
    : [/code]
    : In Delphi, use "open" only to return a result set [select]. Use the "ExecSQL" command for "insert", "delete" and ccmmands that don't return a result. Look for your localSQL help file. They put it in a weird place like in with the BDE or Database Desktop. I'd also recommend using straight SQL rather than Borland commands if you want your app to scale. It might be too late, but I'd recommend TMyDB from http://www.kylix.dubaron.com/ It's free and no licensing fees to worry about.
    :
    Thank you!
Sign In or Register to comment.