Using 2020r2.1 Web
So far i’ve only tried chrome/edge
Still testing as I am writing this.
This 100% could be a user error and I hope it is. I’ve tried this with two different MSSQL databases. Two different update statements (different tables). I am about to test in Web 1.0.
Try var sqlserverupdate as String sqlserverupdate = "UPDATE tblservers SET servername = ?," + _ " description = ?," + _ " dnsname = ?," + _ " os = ?,"+ _ " notes = ?,"+ _ " servicetag = ?,"+ _ " ipaddress = ?,"+ _ " servertype = ?,"+ _ " datatype = ?,"+ _ " locationname = ?"+ _ " WHERE serverid = ?" Session.glodb.ExecuteSQL(sqlserverupdate,txtname.Text,txtdescription.Text,txtdns.Text,popos.SelectedRowValue,txtnotes.Text,txtservicetag.Text,txtip.Text,popservertype.SelectedRowValue,popdatatype.SelectedRowValue,poplocation.SelectedRowValue,serverid) Catch err as DatabaseException MessageBox("Error: " + err.Message) End Try
The statement runs and does not have any errors, but if a field has nothing in it I get weird symbols in the database fields.
DNS was blank on the webpage. After running the command the dns field value is:
I removed the value, saved the record again and got:
Here are a few field values from a separate application, separate database, and different field types. Every blank field has some weird characters:
I’ve tried changing the field types (char,nvarchar,varchar). I’ve tried binding the types. I’ve tried declaring variables = field.text and then using the variables instead of field.text. I confirmed that before the SQL execute they are indeed blank values and not weird characters. It should also be noted that a non-prepared statement works like a charm.
Last night I tried with postgresql and it seemed to work fine. I couldn’t replicate it.
EDIT: Just tried with 1.0 (2019r3.2)
Message: Encountered invalid character.
Looks like if I just replace the blanks with a space it doesn’t input strange symbols/characters
If stringtext = "" Then stringtext = " " End If Return stringtext
I also get the error with SQL INSERT command. SELECT is working properly.