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.
Examples:
DNS was blank on the webpage. After running the command the dns field value is:
://http://127.0.0.1:8080
Referer: http://127.0.0.1:8080
I removed the value, saved the record again and got:
info":{"left":20.0,"top":173.0,"width":225.
Here are a few field values from a separate application, separate database, and different field types. Every blank field has some weird characters:
Phonenumber
y":false,"capt
Pager
µ
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)
Unhandled RuntimeException
Message: Encountered invalid character.Stack:
Xojo.Data.GenerateJSON%y%x
WebResponse._Render%s%o
WebSession._HandleEvent%%oso<_HTTPServer.HTTPRequestContext>
WebSession._HandleRequest%i4%oso<_HTTPServer.HTTPRequestContext>
WebApplication._HandleHTTPRequest%%oo<_HTTPServer.HTTPRequestContext>
_HTTPServer.HTTPRequestThread.Event_Run%%o<_HTTPServer.HTTPRequestThread>
REALbasic._CallFunctionWithExceptionHandling%o%pp
DNS Value:
ç2˜ß͵ôd_dƒþ)p~âØŽ³‚tº“TFAóÿtHëeϸ5ËJ
+Žû€NHP¥ptŒ;æúû[ ëK–׸È
Second EDIT:
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.