I have a bit of DB Code that update columns in my DB. But it for some reason seems to break when starting the edit. Can anyone see the issue
Dim DBRecordEditCall as new DatabaseRecord // This is calling the Databse
Dim sql3 as String // This is setting the SQL Code Needed to bring back data from the saved table
// The SQL CODE is trying to match row in Database with the infomaiton taken from the RouterListbox
sql3 = "select Mins,Password from LockdownStore where Password = '" + PasswordBox.Text
Dim DatabaseEditSet as RecordSet = LockdownDB.SQLSelect(sql3) // Passing the SQL query on the Main Database
DatabaseEditSet.Edit // Setting the start to EDIT the DATABASE
DatabaseEditSet.Field("Mins").StringValue = trim(MinutesInputBox.Text) // Mins
DatabaseEditSet.Field("Password").StringValue = trim(PasswordBox.Text) // Password
DatabaseEditSet.Update // Telling the DB That The Above Info is needed to be updated on select item
LockdownDB.Commit // Database SAVES changes
DatabaseEditSet.Close
When i debug sql3 seems to be adding the passwordbox.text to the string.
The above has worked for me for sometime now as all i wanted to do was match a row. Can you see why my code is not adding an additional ’ to the end to complete the SQL?
sql3 = “select Mins,Password from LockdownStore where Password = '” + ReplaceAll(PasswordBox.Text, “’”) + “’”
But still, if you want to edit records, you need to select a primary key.
Not sure what you’re doing with passwords in database, but depending on the real security needs of your app, you may want to familiarize yourself with this: