Example very very simple of odbc connection view on dbgrid lazarus / 16-Databases ---------------------------------------------------------------------- moespi · 2007-01-22 16:38 Is my firts program on lazarus :? , hope not last using SQLdb components connection odbc must exist for example  to database pubs on sql server 2000  on other server DNS of system:  pubs_out only modifying   DNS of system , SQL , I test retrieving data of informix on solaris 8 Components  TODBCConnection   ODBCConnection1  TSQLQuery         SQLQuery1  TSQLTransaction   SQLTransaction1  TButton           Button1  TDBGrid           DBGrid1  TDatasource       Datasource1 Properties ODBCConnection1  DatabaseName   pubs_out  UserName       usrtmp  Password       usrtmp SQLQuery1  Database       ODBCConnection1  DataSource                                 <---- nothing here  Transaction    SQLTransantion1  SQL            select * from employee SQLTransaction1  Database       ODBCConnection1 DBGrid1   DataSource     Datasource1 Datasource1   DataSet        SQLQuery1   Button1   Caption     Read DB Button2   Captio      Exit Events Button1  on Button1Click   SqlQuery1.Open; Button2  on Button2Click   DBGrid1.Destroy;   datasource1.Destroy;   sqlquery1.Destroy;   sqltransaction1.Destroy;   odbcconnection1.Close;   odbcconnection1.destroy;   close; ---------------------------------------------------------------------- OnixJr · 2008-04-23 00:25 Maybe can you put this step-to-step/code on the wiki with screenshots? Regards, Júnior ---------------------------------------------------------------------- Vincent Snijders · 2008-04-23 12:45 Putting the example in the wiki would be create. If you send me the zip of the sources, I will make them available for download. ---------------------------------------------------------------------- douglastakahara · 2008-04-25 14:55 I could make connection to access, then when I have a while I put a tutorial .. ---------------------------------------------------------------------- moespi · 2008-04-25 20:18 Hello, I on Lazarus < 0.9.24 have a example  working , based on the previous example , but on 0.9.24 and 0.9.25 fail some IndexDef and UsePrimaryKeyAsKey, and the example previous fail on odbc for sql server , but not for odbc for informix on solaris .    i'm looking for how to solve it, help is welcome, send a mail and back with a zip of this sample. Components TODBCConnection ODBCConnection1   (on SQLdb) TSQLQuery SQLQuery1                        (on SQLdb) TSQLTransaction SQLTransaction1        (on SQLdb) TButton Button1                           TEdit Edit1 TEdit Edit2 ---------------------------------------------------------------------- --------------- Properties  ODBCConnection1     Driver    Microsoft Access Driver (*.mdb)     Params     DBQ=c:\directoryOfDB\database.mdb SQLQuery1     Database ODBCConnection1     DataSource <---- nothing here    Transaction SQLTransantion1 SQLTransaction1 Database ODBCConnection1 ---------------------------------------------------------------------- --------------- Events Button1 on Button1Click       sqlquery1.SQL.Clear;     sqlquery1.SQL.Add('select * from tableonDB');     sqlquery1.open;     edit1.Text:=sqlquery1.FieldByName('field1').Text;     {sqlquery1.FieldByName('field1').asinteger ;}     edit2.Text:=sqlquery1.FieldByName('field2').Text;     {sqlquery1.FieldByName('field2').asstring;}   sqltransaction1.Commit;   sqlquery1.Free;   sqltransaction1.Free;   ODBCconnection1.Free;                                                   Form1 on formCreate       edit1.Text:='----';       edit2.Text:='----';