Get value from database column

Hi,

when i am using database, mostly i do populating into a listbox. Now i am trying to create database as a setting of an app…

how to get the value from database column into label or textfield.
Database name : serial.db
table name : check
column name : serial.

[code] dim sql as string

sql = “SELECT serial FROM check”
dim rs as recordSet
rs = app.CheckSerial.sqlSelect( sql )
L_chkid.Text= sql
rs.close[/code]

I dont know where the mistake is, its shows an error.
any helps ?

thanks
regards,
arief

rs = app.CheckSerial.sqlSelect( sql )
if rs<>nil then
  L_chkid.Text= rs.field("serial").stringvalue
else
 L_chkid.Text = ""
 msgbox "db error"+app.checkserial.errormessage
end if

I got an error like,

error

database is set and the value is there too.

thanks
regards,
arief

“check” is a sql keyword
https://www.w3schools.com/sql/sql_ref_keywords.asp

you cannot use it as a table name, or the sql query will not be evaluated correctly.