Search notes:

VBA: cStr

cStr(arg) is a conversion function and converts arg into a string data type.
The format of the string is dependent on the data type of arg which I try to demonstrate with the following simple example:
option explicit

sub main() ' {

    dim bl as boolean
    dim dt as date
    dim em as variant ' Without assignment, a variant variable has teh value empty.
'   dim er as error
    dim nl as variant
    dim nm as long

    dt = 123456.789
    nl = null
    nm = 42

    debug.print cStr(bl ) ' False
    debug.print cStr(dt ) ' 03/01/2238 18:56:10
    debug.print cStr(em ) '
    debug.print cStr(err) ' 40040
 '  debug.print cStr(nl ) ' runtime error '94': Invalid use of Null
    debug.print cStr(nm ) ' 42

end sub ' }
Github repository about-VBA, path: /functions/conversion/cStr.bas

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1738583661, '18.219.241.174', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/VBA/functions/conversion/cStr(61): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78