harinder Active Member Licensed User Longtime User Aug 19, 2017 #1 Hello.. In the SQLDButils example given in the Source code folder, how can I display table in descending order after I add a row? In the btnaddnew_click sub, I am trying Dim query1 as Query Dim curs as Cursor query1=select * from persons ORDER BY Col1 DESC curs= execnonquery ("select * from persons ORDER BY Col1 DESC") But nothing is happening. This might be a very basic question.But, I have just started learning.Thank you for your patient reply. Regards..
Hello.. In the SQLDButils example given in the Source code folder, how can I display table in descending order after I add a row? In the btnaddnew_click sub, I am trying Dim query1 as Query Dim curs as Cursor query1=select * from persons ORDER BY Col1 DESC curs= execnonquery ("select * from persons ORDER BY Col1 DESC") But nothing is happening. This might be a very basic question.But, I have just started learning.Thank you for your patient reply. Regards..
M Mahares Expert Licensed User Longtime User Aug 19, 2017 #2 Your code should be like this: Code: Copy Sub Process_Globals Dim sql1 As SQL 'need to check mark the SQL library in lib pane End Sub Dim query1 As String Dim curs As Cursor query1="Select * from persons ORDER BY Col1 DESC" curs= sql1.ExecQuery(query1) Upvote 0
Your code should be like this: Code: Copy Sub Process_Globals Dim sql1 As SQL 'need to check mark the SQL library in lib pane End Sub Dim query1 As String Dim curs As Cursor query1="Select * from persons ORDER BY Col1 DESC" curs= sql1.ExecQuery(query1)
klaus Expert Licensed User Longtime User Aug 19, 2017 #3 In the Edit module in the FillWebView routine you can change this line Query = "SELECT * FROM " & Main.DBTableName by this one: Query = "SELECT * FROM " & Main.DBTableName & " ORDER BY ID DESC" Upvote 0
In the Edit module in the FillWebView routine you can change this line Query = "SELECT * FROM " & Main.DBTableName by this one: Query = "SELECT * FROM " & Main.DBTableName & " ORDER BY ID DESC"
harinder Active Member Licensed User Longtime User Aug 20, 2017 #4 klaus said: In the Edit module in the FillWebView routine you can change this line Query = "SELECT * FROM " & Main.DBTableName by this one: Query = "SELECT * FROM " & Main.DBTableName & " ORDER BY ID DESC" Click to expand... Thank you klaus..once again your solution has worked perfectly Upvote 0
klaus said: In the Edit module in the FillWebView routine you can change this line Query = "SELECT * FROM " & Main.DBTableName by this one: Query = "SELECT * FROM " & Main.DBTableName & " ORDER BY ID DESC" Click to expand... Thank you klaus..once again your solution has worked perfectly
DonManfred Expert Licensed User Longtime User Aug 20, 2017 #5 I suggest to learn the SQL Syntax https://sqlite.org/lang.html Upvote 0
harinder Active Member Licensed User Longtime User Aug 21, 2017 #6 DonManfred said: I suggest to learn the SQL Syntax https://sqlite.org/lang.html Click to expand... Yes..it is a big subject and I am working on it part-time.. Upvote 0
DonManfred said: I suggest to learn the SQL Syntax https://sqlite.org/lang.html Click to expand... Yes..it is a big subject and I am working on it part-time..
klaus Expert Licensed User Longtime User Aug 21, 2017 #7 You could also have a look at the B4A User's Guide chapter 5 SQLite Database. Upvote 0