Most likely you are working on an older project file that started on a Xojo version that didn’t have DesktopXYZ controls.
You can try to convert your App to DesktopApp:
If you are going to convert please read the many posts about doing so. There are better ways than converting the entire Application in one go. Step by step is easier.
@TimStreater Just an observation!
It is a small application with odbcdatabase connection, recordset, listbox, contextual menu.
like…
SQLSelect became Select SQL
RecordSet became RowSet
rs.EOF became rs.AfterLastRow
rs.BOF became rs.BeforeFirstRow
rs.MoveNext → rs.MoveToNextRow
rs.MovePrevious → rs.MoveToPreviousRow
rs.Field → rs.Column
Listbox is DesktopListbox with properties change.
I just can’t imagine on my level of understanding XOJO (newbie). how can the developers of previous version handle this situation.
Several haven’t updated to API 2.
Others only change what they need.
The rest decided to attack the conversion, started updating some parts, then others, and then the rest until they have full API 2 project.
I read that some, with small projects, created a new project and started transferring or coding the project almost as new.
I was helped at least to some extent in that I do all database access through wrapper methods, because I want to log any errors. Like this:
sub dbquery (Extends dbh as sqlitedatabase, sql at String, where as String, ParamArray args as Variant) as RowSet
// Called when we expect a RowSet to be returned. Returns the RowSet if rows are found without error.
// Returns Nil if no rows found. Also returns Nil if an error occurs, in which case a message is logged also.
Var reg As RowSet, errnum As Integer, errmsg As String
try
reg = dbh.SelectSQL (sql, args)
Return reg // Worked fine, just return
Catch e as DatabaseException
app.dbErrorsCount = app.dbErrorsCount + 1
errnum = e.ErrorNumber
errmsg = e.Message
end try
dblogmsg (errnum, errmsg, where, sql, args)
Return Nil
End Sub
.
So I had to change at least these in only one place. Most of it is just a careful editing job.