Take variable MYSQL

I need take time of my server MYSQL use is command now()

mysql> set @hora_actual=now();
Query OK, 0 rows affected (0.45 sec)

mysql> select @hora_actual;
| @hora_actual |
| 2013-11-27 20:42:51 |
1 rows in set (9.71 sec)

But,what is format correct for take is value

verloticket = db.SQLSelect("@hora_actual’)

is not work.

verloticket = db.SQLSelect(“select now()”)

Excuse, but is order is :

verloticket = db.SQLSelect(“select now()”)

Dim rs as RecordSet = db.SQLSelect(verloticket)

TextField1.Text= verloticket

is correct?

Sorry yes
something like

dim rs as recordset = db.SQLSelect("select now()") TextField1.Text= rs.idxField(1).StringValue

add error checks as needed

But fail, is error


You refer to ID in your FIELD statement but not in your SELECT statement.

not work,

dim verloo as String
dim rs as recordset = db.SQLSelect("select now() as id")
verloo = str(rs.idxField(1).IntegerValue)

[quote=49478:@Fernando Pinto]But fail, is error
I can see your code isn’t what I wrote :stuck_out_tongue:

I literally just wrote

[code] dim db as new MySQLCommunityServer
db.Host = “”
db.DatabaseName = “*******”
db.port = 3306
db.UserName = “********”

if db.connect() then
dim rs as recordset = db.SQLSelect(“select now()”)
dim s as string = rs.idxField(1).StringValue
end if[/code]

and s = “2013-11-27 20:46:35”