I have this sub:
but an error is displays, see attached image.
In practice the last quote is omitted, why?
Cod is a data formatting as string (es: 21/02/2014)
B4X:
In Globals quote = Chr(39)
Public Sub ReadAllFind(DataTable, Colname, Cod) 'ricerca fatta per Cod nel campo Data <Colname>
Dim i, y As Number
Dim s
SQL.CreateConnection(AppPath & "\Archivi\" & DataTable & ".sql", SQL.PassSQL)
y = SQL.GetTableCount(DataTable)
If y > 0 Then
SQL.Connection.BeginTransaction
SQL.Command.AddParameter(Colname)
SQL.Command.SetParameter(Colname, Cod)
SQL.Command.CommandText = "SELECT * FROM " & DataTable & " WHERE " & ColName & " = " & quote & Cod & quote
SQL.Data.Value = SQL.Command.ExecuteReader
If SQL.Data.ReadNextRow = True Then
For i = 0 To y - 1
s = s & SQL.Data.GetValue(i) & CRLF
Next i
Else
End If
SQL.Data.Close
SQL.Connection.EndTransaction
End If
SQL.CloseConnection(AppPath & "\Archivi\" & DataTable & ".sql", False)
Return s
End Sub
but an error is displays, see attached image.
In practice the last quote is omitted, why?
Cod is a data formatting as string (es: 21/02/2014)
Attachments
Last edited: