I have a text field in my window, and the content gets saved to my database with no problems.
I have now noticed however, that if I use a hyphen in the text field and then try to save it to the database - it works as expected (or at least I do NOT see any error messages) until I try to populate a text area with the entry - Then I get an error message saying there is no record found?
The only code I have attached to the text field is a declare in the open event, which creates a rounded text field:
declare sub setBezelStyle lib "Cocoa" selector "setBezelStyle:" ( handle as integer, value as integer )
setBezelStyle( me.handle, 1 )
The code I use to save to the database is below:
[code] // UPDATE THE DATABASE IF BOTH TEXT FIELDS HAVE DATA
If TitleField.text <> “” And CodeField.text <> “” Then
// CHECK FOR DATABASE ERROR If db.Error Then MsgBox("Error: " + Str(db.ErrorCode) + " - " + db.ErrorMessage) Return Else // COMMIT THE CHANGES db.commit // UPDATE THE LISTBOX MainWindow.Timer2.mode = MainWindow.Timer2.ModeSingle // CLOSE THE WINDOW Self.Close end if
The code I use to display the entry in a text area is as follows:
[code] // POPULATE THE CODETEXTAREA
dim sql, selected as string
sql=“select SRef, Title, Code from Snippets where Title=’”+selected+"’"
if rs=nil then
msgbox(“No record found.”)
dim s as string = DefineEncoding( rs.field(“Code”).StringValue , Encodings.UTF8 )
Does anyone have any ideas?