Android Question SQLite insert problem

grafsoft

Well-Known Member
Licensed User
Longtime User
Hi,

I must be doing something wrong, see the code below.

What I do not understand - I get no error message! Please help me find out how to analyze the problem.

Thank you

Peter



B4X:
Sub saveittodb (i As Int)
   Dim n,s As String
   n=addslashes(chosencontact)
   
   DateTime.dateformat="yyyy-MM-dd"
   
   s = "insert into voices values ('" & DateTime.date(DateTime.Now) & " " & DateTime.Time(DateTime.Now) & "','" & n & "'," & i & ", ?)"
   
   Dim InputStream1 As InputStream
  InputStream1 = File.OpenInput(File.DirRootExternal, "temp.3gpp")
  Dim OutputStream1 As OutputStream
  OutputStream1.InitializeToBytesArray(1000)
  File.Copy2(InputStream1, OutputStream1)
  Dim Buffer() As Byte 'declares an empty array
  Buffer = OutputStream1.ToBytesArray
   
   
   SQL1.BeginTransaction
  Try
     SQL1.ExecNonQuery2(s, Array As Object(Buffer))
  Catch
     Log(LastException.Message)
  End Try
  SQL1.EndTransaction
   
End Sub
 

grafsoft

Well-Known Member
Licensed User
Longtime User
Sorry, found the solution: TransactionSuccessful
Butt there is apparently no way to delete a post.
 
Upvote 0

mangojack

Well-Known Member
Licensed User
Longtime User
delete what post ?
 
Upvote 0
Top