Harris Expert Licensed User Longtime User Mar 29, 2011 #1 A ClientDataSet in Every Database Application The above link / article explains the workings of a CLientDataSet. I am accustomed to working with tables in Delphi and such. After retreiving a dataset using SetRange(begin, end ), I would load the results into a TTable and use the following table methods. If not Table.active then Table.open end if Table.first; While Not Table.eof() do Begin Table.edit; // process fields however... Table.next; end; If table.state in [dsEdit, dsInsert] then Table.post; end if; Table.close; I grid would be most useful for displaying feilds from a recordset. I looked at the table example and see how it functions (to some degree) I do not know how to iterate records using SQL commands in a fashion similar to that above... Thanks MHW
A ClientDataSet in Every Database Application The above link / article explains the workings of a CLientDataSet. I am accustomed to working with tables in Delphi and such. After retreiving a dataset using SetRange(begin, end ), I would load the results into a TTable and use the following table methods. If not Table.active then Table.open end if Table.first; While Not Table.eof() do Begin Table.edit; // process fields however... Table.next; end; If table.state in [dsEdit, dsInsert] then Table.post; end if; Table.close; I grid would be most useful for displaying feilds from a recordset. I looked at the table example and see how it functions (to some degree) I do not know how to iterate records using SQL commands in a fashion similar to that above... Thanks MHW
A alibaba Member Licensed User Longtime User Mar 30, 2011 #2 Sub LogTable1 Dim Cursor1 As Cursor Cursor1 = SQL1.ExecQuery("SELECT col1, col2, col3 FROM table1") For i = 0 To Cursor1.RowCount - 1 Cursor1.Position = i Log("************************") Log(Cursor1.GetString("col1")) Log(Cursor1.GetInt("col2")) Log(Cursor1.GetInt("col3")) Next Cursor1.Close End Sub Look at http://www.b4x.com/forum/basic4android-getting-started-tutorials/6736-sql-tutorial.html SQL tutorial...
Sub LogTable1 Dim Cursor1 As Cursor Cursor1 = SQL1.ExecQuery("SELECT col1, col2, col3 FROM table1") For i = 0 To Cursor1.RowCount - 1 Cursor1.Position = i Log("************************") Log(Cursor1.GetString("col1")) Log(Cursor1.GetInt("col2")) Log(Cursor1.GetInt("col3")) Next Cursor1.Close End Sub Look at http://www.b4x.com/forum/basic4android-getting-started-tutorials/6736-sql-tutorial.html SQL tutorial...
Erel B4X founder Staff member Licensed User Longtime User Mar 30, 2011 #3 See the new DBUtils code module: http://www.b4x.com/forum/basic4andr...475-dbutils-android-databases-now-simple.html
See the new DBUtils code module: http://www.b4x.com/forum/basic4andr...475-dbutils-android-databases-now-simple.html
Harris Expert Licensed User Longtime User Mar 31, 2011 #4 Ask and ye shall provide! Thanks - I will try these out.. This is why I love this stuff...