Android Question How can i implement two where clauses b4a

Makumbi

Active Member
Licensed User
iam getting error too many paramenters when i try to implemement this please help

B4X:
Dim strSQL As String
            Dim strName As String
            Dim strNames As String
            Try
                strName =Rsms.Text
                strNames =Rsms2.Text
                If strName = "no filter" Then
                    MsgboxAsync("Please select a Name to delete", "E R R O R")
                    Return
                End If
                strSQL = "DELETE FROM SMSlist WHERE sms = ? AND Datesent = ?"
                Starter.SQL1.ExecNonQuery2(strSQL, Array As Object(strName), strNames)
    
                InitSpinners
            Catch
                Log(LastException)
            End Try
 

BillMeyer

Well-Known Member
Licensed User
Good Day,

Change this
B4X:
Starter.SQL1.ExecNonQuery2(strSQL, Array As Object(strName), strNames)
To This
B4X:
Starter.SQL1.ExecNonQuery2(strSQL, Array As Object(strName, strNames))
As our dear Sherlock would say, "Elementary, Mr Makumbi, Elementary......."

Also another tip, watch your naming conventions - later on, in a large project, strName and strNames will be read as one (by your tired eyes) and can lead to hours of searching frustration on your behalf.

Enjoy your Day !!!
 

Makumbi

Active Member
Licensed User
Good Day,

Change this
B4X:
Starter.SQL1.ExecNonQuery2(strSQL, Array As Object(strName), strNames)
To This
B4X:
Starter.SQL1.ExecNonQuery2(strSQL, Array As Object(strName, strNames))
As our dear Sherlock would say, "Elementary, Mr Makumbi, Elementary......."

Enjoy your Day !!!
hahaha you have me for sure bill
 
Top