V vdudukov Member Licensed User Longtime User Aug 31, 2013 #1 Hello again! I have a little problem with My tables in SQLite database. Well, I have a one SQLite database with lot of table names. Example 20_2013, 21_2013, 22_2013 etc. I want to load all these tables in ListView but without this sign "_" example 20 2013 not 20_2013. I create this function to load all tables from SQLite database, but i dont know how to replace "_" only in ListView, not in SQLite database because it must be with "_" in SQLdatabase. I use DBUtils. DBUtils.ExecuteListView(database, "SELECT name FROM sqlite_master WHERE type = 'table'", Null, 0, db_table, False) Thank You All
Hello again! I have a little problem with My tables in SQLite database. Well, I have a one SQLite database with lot of table names. Example 20_2013, 21_2013, 22_2013 etc. I want to load all these tables in ListView but without this sign "_" example 20 2013 not 20_2013. I create this function to load all tables from SQLite database, but i dont know how to replace "_" only in ListView, not in SQLite database because it must be with "_" in SQLdatabase. I use DBUtils. DBUtils.ExecuteListView(database, "SELECT name FROM sqlite_master WHERE type = 'table'", Null, 0, db_table, False) Thank You All
M Merlot2309 Active Member Licensed User Longtime User Aug 31, 2013 #2 Hello, You can use a string var, e.g. Dim day as string day = DBUtils.ExecuteListView(database, "SELECT name FROM sqlite_master WHERE type = 'table'", Null, 0, db_table, False) day = day.Replace("_", " ") Success Upvote 0
Hello, You can use a string var, e.g. Dim day as string day = DBUtils.ExecuteListView(database, "SELECT name FROM sqlite_master WHERE type = 'table'", Null, 0, db_table, False) day = day.Replace("_", " ") Success
V vdudukov Member Licensed User Longtime User Aug 31, 2013 #3 Merlot2309 said: Hello, You can use a string var, e.g. Dim day as string day = DBUtils.ExecuteListView(database, "SELECT name FROM sqlite_master WHERE type = 'table'", Null, 0, db_table, False) day = day.Replace("_", " ") Success Click to expand... Thanks, but not working Upvote 0
Merlot2309 said: Hello, You can use a string var, e.g. Dim day as string day = DBUtils.ExecuteListView(database, "SELECT name FROM sqlite_master WHERE type = 'table'", Null, 0, db_table, False) day = day.Replace("_", " ") Success Click to expand... Thanks, but not working
M Merlot2309 Active Member Licensed User Longtime User Aug 31, 2013 #4 Oeps, I missed the DBUtils. Upvote 0
D devlei Active Member Licensed User Longtime User Aug 31, 2013 #5 Try it directly with SQLite - something like (untested code): Code: Copy Dim cur As Cursor Dim sqlDB As SQL Dim day As String Dim strQuery As String 'ListView1 is from layout strQuery = "SELECT name FROM sqlite_master WHERE type = 'table'" sqlDB.BeginTransaction Try cur = sqlDB.ExecQuery(strQuery) For i = 0 To cur.RowCount - 1 cur.Position = i day = cur.GetString("day") day = day.Replace("_", " ") ListView1.AddSingleLine2(day, day) Next sqlDB.TransactionSuccessful Catch Msgbox(LastException.Message, "Fill ListView Error") End Try sqlDB.EndTransaction Upvote 0
Try it directly with SQLite - something like (untested code): Code: Copy Dim cur As Cursor Dim sqlDB As SQL Dim day As String Dim strQuery As String 'ListView1 is from layout strQuery = "SELECT name FROM sqlite_master WHERE type = 'table'" sqlDB.BeginTransaction Try cur = sqlDB.ExecQuery(strQuery) For i = 0 To cur.RowCount - 1 cur.Position = i day = cur.GetString("day") day = day.Replace("_", " ") ListView1.AddSingleLine2(day, day) Next sqlDB.TransactionSuccessful Catch Msgbox(LastException.Message, "Fill ListView Error") End Try sqlDB.EndTransaction
V vdudukov Member Licensed User Longtime User Aug 31, 2013 #6 devlei said: Try it directly with SQLite - something like (untested code): Code: Copy Dim cur As Cursor Dim sqlDB As SQL Dim day As String Dim strQuery As String 'ListView1 is from layout strQuery = "SELECT name FROM sqlite_master WHERE type = 'table'" sqlDB.BeginTransaction Try cur = sqlDB.ExecQuery(strQuery) For i = 0 To cur.RowCount - 1 cur.Position = i day = cur.GetString("day") day = day.Replace("_", " ") ListView1.AddSingleLine2(day, day) Next sqlDB.TransactionSuccessful Catch Msgbox(LastException.Message, "Fill ListView Error") End Try sqlDB.EndTransaction Click to expand... Merlot2309 said: Oeps, I missed the DBUtils. Click to expand... No problem, thanks anyway Upvote 0
devlei said: Try it directly with SQLite - something like (untested code): Code: Copy Dim cur As Cursor Dim sqlDB As SQL Dim day As String Dim strQuery As String 'ListView1 is from layout strQuery = "SELECT name FROM sqlite_master WHERE type = 'table'" sqlDB.BeginTransaction Try cur = sqlDB.ExecQuery(strQuery) For i = 0 To cur.RowCount - 1 cur.Position = i day = cur.GetString("day") day = day.Replace("_", " ") ListView1.AddSingleLine2(day, day) Next sqlDB.TransactionSuccessful Catch Msgbox(LastException.Message, "Fill ListView Error") End Try sqlDB.EndTransaction Click to expand... Merlot2309 said: Oeps, I missed the DBUtils. Click to expand... No problem, thanks anyway
V vdudukov Member Licensed User Longtime User Sep 1, 2013 #7 devlei said: Try it directly with SQLite - something like (untested code): Code: Copy Dim cur As Cursor Dim sqlDB As SQL Dim day As String Dim strQuery As String 'ListView1 is from layout strQuery = "SELECT name FROM sqlite_master WHERE type = 'table'" sqlDB.BeginTransaction Try cur = sqlDB.ExecQuery(strQuery) For i = 0 To cur.RowCount - 1 cur.Position = i day = cur.GetString("day") day = day.Replace("_", " ") ListView1.AddSingleLine2(day, day) Next sqlDB.TransactionSuccessful Catch Msgbox(LastException.Message, "Fill ListView Error") End Try sqlDB.EndTransaction Click to expand... Thank You Upvote 0
devlei said: Try it directly with SQLite - something like (untested code): Code: Copy Dim cur As Cursor Dim sqlDB As SQL Dim day As String Dim strQuery As String 'ListView1 is from layout strQuery = "SELECT name FROM sqlite_master WHERE type = 'table'" sqlDB.BeginTransaction Try cur = sqlDB.ExecQuery(strQuery) For i = 0 To cur.RowCount - 1 cur.Position = i day = cur.GetString("day") day = day.Replace("_", " ") ListView1.AddSingleLine2(day, day) Next sqlDB.TransactionSuccessful Catch Msgbox(LastException.Message, "Fill ListView Error") End Try sqlDB.EndTransaction Click to expand... Thank You