I am trying to create csv files from my sql database to be able to transfer them to my PC.
The table contains information, and the cursor shows that all rows are found.
When i use StringUtils.SaveCSV, i get no errors. But I cannot find the resulting file(s) anywhere on my phone.
( I upladed the .apk to the phone and installed it. It works except for the csv creation.)
Any Ideas? Anyone?
:sign0163:
The table contains information, and the cursor shows that all rows are found.
When i use StringUtils.SaveCSV, i get no errors. But I cannot find the resulting file(s) anywhere on my phone.
( I upladed the .apk to the phone and installed it. It works except for the csv creation.)
Any Ideas? Anyone?
:sign0163:
B4X:
Sub SaveWorkoutsToCSV
Dim WorkoutList As List
Dim ExerciseList As List
Dim ne As Int 'row counter to check
Dim qry As String
Dim StringUtils As StringUtils
WorkoutList.Initialize
ExerciseList.Initialize
'workoutlist=DBUtils.ExecuteMemoryTable(SQL1,qry,Null,0)
'Msgbox(File.DirInternal,"workouts")
qry = "Select * from Workouts"
Dim cur As Cursor
cur = SQL1.ExecQuery(qry)
Msgbox(cur.RowCount,"number") 'check if any rows are found
For row = 0 To cur.RowCount - 1
cur.Position = row
Dim values(cur.ColumnCount) As String
For col = 0 To cur.ColumnCount - 1
values(col) = cur.GetString2(col)
Next
WorkoutList.Add(values)
'Msgbox(values(2),"values") 'check if any data found in col 2
Next
cur.Close
StringUtils.SaveCSV(File.Dirinternal, "workouts.csv", ",",WorkoutList)
End Sub