This code has been working just fine for ages. Now I recomplile and it halts with the error above.
An SQLite database with a table of filenames is downloaded from the server. The database is then opened and the list of files is downloaded..... Not any more. The database now appears to initialise OK but then it halts when you try to define the first ResultSet from it. The database is NOT encrypted.
iHTTP ver 1.01
iSQL ver 1.30
An SQLite database with a table of filenames is downloaded from the server. The database is then opened and the list of files is downloaded..... Not any more. The database now appears to initialise OK but then it halts when you try to define the first ResultSet from it. The database is NOT encrypted.
iHTTP ver 1.01
iSQL ver 1.30
B4X:
Sub JobDone (Job As HttpJob)
If Job.Success = True Then
Select Job.JobName
Case "FileList" 'Handle the Filelist database
Dim out As OutputStream = File.OpenOutput(File.DirLibrary,"b747kb.sqlite", False)
File.Copy2(Job.GetInputStream, out)
out.Close
Progress("SQLite Database Downloaded")
Progress(Job.JobName & "Download")
Main.SQL1.Initialize(File.DirLibrary,"b747kb.sqlite",False)
'Program halts at this query
Dim Files As ResultSet = Main.SQL1.ExecQuery("SELECT * FROM FileList ORDER BY File")
Dim fname As String
Do While Files.NextRow
Dim Job2 As HttpJob
fname = Files.GetString("File")
Progress("Downloading.... " & fname)
Job2.Initialize(fname,Me)
Job2.Username = usr
Job2.Password = pw
Job2.Download(URLprefix & fname)
Loop
Case Else 'Handles the rest
Progress(Job.JobName & " .....Downloaded")
Dim out As OutputStream = File.OpenOutput(File.DirLibrary,Job.JobName, False)
File.Copy2(Job.GetInputStream, out)
out.Close
End Select
Else
Progress("Error: " & Job.ErrorMessage)
End If
End Sub
Application_Start
Application_Active
Unknown error calling sqlite3_step (10: disk I/O error) rs
response success
DB Error: 26 "file is encrypted or is not a database"
DB Query: SELECT * FROM FileList ORDER BY File
DB Path: /var/mobile/Containers/Data/Application/3606C352-8908-4046-9C2D-5A97ACD3C2A1/Library/b747kb.sqlite
Error occurred on line: 76 (UpdateFiles)
ExecQuery error: file is encrypted or is not a database
Stack Trace: (
CoreFoundation <redacted> + 152
libobjc.A.dylib objc_exception_throw + 38
CoreFoundation <redacted> + 0
B747 KB -[B4ISQL ExecQuery2::] + 340
B747 KB -[b4i_updatefiles _jobdone:] + 3486
CoreFoundation <redacted> + 68
CoreFoundation <redacted> + 300
B747 KB +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1784
B747 KB -[B4ICommon CallSubDebug4::::] + 1158
B747 KB -[B4ICommon CallSubDebug2::::] + 250
B747 KB -[b4i_httpjob _complete::] + 994
B747 KB -[b4i_httputils2service _completejob::::] + 1680
B747 KB -[b4i_httputils2service _hc_responsesuccess::] + 1106
CoreFoundation <redacted> + 68
CoreFoundation <redacted> + 300
B747 KB +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1784
B747 KB -[B4IShell runMethod:] + 590
B747 KB -[B4IShell raiseEventImpl:method:args::] + 2024
B747 KB -[B4IShellBI raiseEvent:event arams:] + 1552
B747 KB __61-[B4IHttp URLSession:downloadTask:didFinishDownloadingToURL:]_block_invoke + 240
libdispatch.dylib <redacted> + 222
libdispatch.dylib <redacted> + 22
libdispatch.dylib _dispatch_main_queue_callback_4CF + 902
CoreFoundation <redacted> + 8
CoreFoundation <redacted> + 848
CoreFoundation CFRunLoopRunSpecific + 470
CoreFoundation CFRunLoopRunInMode + 104
GraphicsServices GSEventRunModal + 80
UIKit UIApplicationMain + 150
B747 KB main + 106
libdyld.dylib <redacted> + 2
Application_Active
Unknown error calling sqlite3_step (10: disk I/O error) rs
response success
DB Error: 26 "file is encrypted or is not a database"
DB Query: SELECT * FROM FileList ORDER BY File
DB Path: /var/mobile/Containers/Data/Application/3606C352-8908-4046-9C2D-5A97ACD3C2A1/Library/b747kb.sqlite
Error occurred on line: 76 (UpdateFiles)
ExecQuery error: file is encrypted or is not a database
Stack Trace: (
CoreFoundation <redacted> + 152
libobjc.A.dylib objc_exception_throw + 38
CoreFoundation <redacted> + 0
B747 KB -[B4ISQL ExecQuery2::] + 340
B747 KB -[b4i_updatefiles _jobdone:] + 3486
CoreFoundation <redacted> + 68
CoreFoundation <redacted> + 300
B747 KB +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1784
B747 KB -[B4ICommon CallSubDebug4::::] + 1158
B747 KB -[B4ICommon CallSubDebug2::::] + 250
B747 KB -[b4i_httpjob _complete::] + 994
B747 KB -[b4i_httputils2service _completejob::::] + 1680
B747 KB -[b4i_httputils2service _hc_responsesuccess::] + 1106
CoreFoundation <redacted> + 68
CoreFoundation <redacted> + 300
B747 KB +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1784
B747 KB -[B4IShell runMethod:] + 590
B747 KB -[B4IShell raiseEventImpl:method:args::] + 2024
B747 KB -[B4IShellBI raiseEvent:event
B747 KB __61-[B4IHttp URLSession:downloadTask:didFinishDownloadingToURL:]_block_invoke + 240
libdispatch.dylib <redacted> + 222
libdispatch.dylib <redacted> + 22
libdispatch.dylib _dispatch_main_queue_callback_4CF + 902
CoreFoundation <redacted> + 8
CoreFoundation <redacted> + 848
CoreFoundation CFRunLoopRunSpecific + 470
CoreFoundation CFRunLoopRunInMode + 104
GraphicsServices GSEventRunModal + 80
UIKit UIApplicationMain + 150
B747 KB main + 106
libdyld.dylib <redacted> + 2