Sub RunAllocs
SQL.BeginTransaction
SQL.ExecNonQuery("DROP TABLE IF EXISTS Allocations")
SQL.ExecNonQuery("CREATE TABLE Allocations (Date TEXT, UserID INTEGER , Site TEXT, Timeslot TEXT, Info TEXT, Postcode TEXT)")
' Try
Dim lst1 As List
lst1 = su.LoadCSV(File.DirLibrary,"Allocation.csv", ",")
For i = 1 To lst1.Size - 1
Dim sColumn() As String
sColumn = lst1.Get(i)
SQL.ExecNonQuery2("INSERT INTO Allocations (Date,UserID,Site,Timeslot,Info,Postcode) VALUES (?, ?, ?, ?, ?, ?)", sColumn)
Next
SQL.TransactionSuccessful
' Catch
' Log(LastException.Description)
' End Try
' SQL.ExecNonQuery("DELETE FROM Allocations WHERE UserID <> '" & Main.AuditorNo & "'")
Dim CHecktxt As String
CHecktxt = SearchMe.Text
If Checkbox1.Value = False Then
DBUtils.ExecuteListView(SQL, "SELECT Site FROM Allocations WHERE Date ='" & TodayIs & "' AND Site LIKE '%" & CHecktxt & "%'", Null, 0, Listview1, False)
Else
DBUtils.ExecuteListView(SQL, "SELECT Site FROM Allocations WHERE Site LIKE '%" & CHecktxt & "%'", Null, 0, Listview1, False)
End If
SQL.Close
End Sub