Logo
Home Cart [Log In] About Us Contact Us

Object Reference

xf_BaseInstanceXF Base Module

Public Function q (
i As Variant
) As String

Adds single quotes around the passed value. Quotes are escaped, so for example if the value O'Leary was passed, the result would be 'O''Leary'. This form of escaping is supported by JET and MSSQL Server. The value NULL returns empty quotes (ie. ''). Using the q() function also protexcts from SQL injection attacks and results in more readable code.

i as Variant

The variant value to quote

Call Template:

Dim s As String
s = q(i)

See Also:

Example 1:

1
Docmd.RunSQL "UPDATE tblSample SET SampleCount=1 WHERE Gender=" & q(nz(Me.cboGender))
Contact Us :: About Us :: Policies :: email: infspamo@arrospamw-of-tispamme.com    © 2012 Arrow Of Time Pty Ltd