Recent

Author Topic: [SOLVED] Lazarus 0.9.30.2 MySQL 5.5.13 GRANT and REVOKE  (Read 3970 times)

lazguy

  • Jr. Member
  • **
  • Posts: 78
[SOLVED] Lazarus 0.9.30.2 MySQL 5.5.13 GRANT and REVOKE
« on: February 03, 2012, 06:31:40 pm »
Hi All, here again !!!!!!

Is it possible to use the MySQL  SQL commands GRANT and REVOKE directly from my code ?

Please, how to do this ?
« Last Edit: February 08, 2012, 02:35:42 am by lazguy »

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Lazarus 0.9.30.2 MySQL 5.5.13 GRANT and REVOKE
« Reply #1 on: February 03, 2012, 07:35:23 pm »
I suspect so. What have you tried up to now? What did go wrong and what error messages appeared?

There's a difference between SQL statements returning data (e.g. SELECT statements) and statements that do something (INSERT, UPDATE, calling some stored procedures, GRANT, REVOKE).

For the latter you use, IIRC, the Execute method of the query object. See the wiki on databases (e.g. SQLDB Tutorial1) for more details...

Edit: seems you're fairly new here. Some tips: it helps to search through the wiki and forum for things... Also, in general, the FPC documentation is excellent.

I know I had big troubles getting database access to work, not having a Delphi background.
It helps if you tell us what you tried (or tried searching for) and what failed, what Lazarus version, what operating system you're using... this way guessing games will hopefully be limited.

Good luck,
BigChimp
« Last Edit: February 03, 2012, 07:38:42 pm by BigChimp »
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

ludob

  • Hero Member
  • *****
  • Posts: 1173
Re: Lazarus 0.9.30.2 MySQL 5.5.13 GRANT and REVOKE
« Reply #2 on: February 03, 2012, 07:40:40 pm »
Use TMysqlxxConnection.ExecuteDirect. Replace xx with the MySQL version you are using.

lazguy

  • Jr. Member
  • **
  • Posts: 78
Re: Lazarus 0.9.30.2 MySQL 5.5.13 GRANT and REVOKE
« Reply #3 on: February 06, 2012, 02:51:31 pm »
Thank You very Much, BigChimp and ludob.

It is possible.

Problem Solved.

 

TinyPortal © 2005-2018