SAMPLE MySQL lazarus / 1-Linux ---------------------------------------------------------------------- rhmargus · 2004-09-22 11:48 I use Fedora Core 2. Succsessfuly install lazarus and components. I placed on form MySQLDataset1, Datasource1 and dbGrid. How to use? -  connect to MySQL ( VIEW,INSERT,UPDATE,QUERY ) I read evrithing for mysql_v4 etc ... but I wont to use directly of control. Do you must use on design no runtime? I need sample of tutorial. ---------------------------------------------------------------------- Lightning · 2004-09-22 14:06 It may be fixed in the latest updates(cvs) but if you mean using a DBGrid at designtime and make it active then it's not posible to run that program but you can do this in code and you can't edit data using the grid since it only has read-only support. I might be wrong since things change in the latest updates. ---------------------------------------------------------------------- rhmargus · 2004-09-23 08:30 I placed on form TMySQLDatabase1,MySQLDataset1,dbGrid1,Datasource1 & Button1, and I add procedure TForm1.Button1Click(Sender: TObject); var db:TDatabase; begin     TMySQLDatabase1.DatabaseName:='plate';     TMySQLDatabase1.HostName:='192.168.0.254';     TMySQLDatabase1.UserName:='admin';     TMySQLDatabase1.Password:='nimad';     Datasource1.DataSet:=MySQLDataset1;     dbGrid1.DataSource:=Datasource1;     db.Name:='plate';     MySQLDataset1.DataBase:=db;     MySQLDataset1.Active:=true;     TMySQLDatabase1.Open; end; In the same control of TMySQLDatabase1.Params I add "SELECT * FROM login" When i build and start application, after click on button the messagebox is:          "Access violation" (No message in Message Window) Where I was wrong ????????????????????? p.s. MySQL is active,host is OK, uname & password is OK ... ---------------------------------------------------------------------- Anonymous · 2004-09-23 09:31 You placed a query in the params of a database. That is not going to work. If MySQLDataset1 is a TQuery decendant, place your query in MySQLDataset1.Sql.Text ---------------------------------------------------------------------- rhmargus · 2004-09-23 20:58 I used TMySQLDataset1.Sql.Text and more variations but still no work. Finaly lazarus show me messagebox TMySQLDataset cannot access database 'plate' ; for user: '@localhost' TMySQLDatabase1.DatabaseName:='plate'; TMySQLDatabase1.HostName:='192.168.0.254'; TMySQLDatabase1.UserName:='admin'; TMySQLDatabase1.Password:='nimda'; TMySQLDataset1.Sql.Text:='SELECT * FROM login'; TMySQLDataset1.Open; Please what's wrong. Please write me SUCCSESSSFUL code !!! p.s. I write 'admin' user, who is '@localhost', why not recognise ????????? ---------------------------------------------------------------------- Marc · 2004-09-24 08:33 Quote TMySQLDataset cannot access database 'plate' ; for user: '@localhost' This message look clear to me. Do users form localhost have access to your DB ? Quote TMySQLDatabase1.DatabaseName:='plate'; TMySQLDatabase1.HostName:='192.168.0.254'; TMySQLDatabase1.UserName:='admin'; TMySQLDatabase1.Password:='nimda'; TMySQLDataset1.Sql.Text:='SELECT * FROM login'; TMySQLDataset1.Open; Please what's wrong. Please write me SUCCSESSSFUL code !!! I haven't tried to connet to MySQL yet. I only know hot to use databases within Delphi. This code looks OK, we cant write "successfull" code for your environment. Is your DB located on the same machine or on another ? ---------------------------------------------------------------------- rhmargus · 2004-09-24 17:17 You apsolutly right. I found that. MySQL Server on other machine, those not have privilegies to access for this host. Code is ALL RIGHT. Thanks for support.