Logo
Home Cart [Log In] About Us Contact Us

Object Reference

xf_ScripterSQL Script Generation and Processing

Public Function SqlFormatFieldVal (
FieldType As DAO.DataTypeEnum,
val As Variant,
Optional MssqlMode As Boolean = False
) As String

Return a value formatted for an SQL script according to the specified DataTypeEnum. Binary columns return a value of 0, as JET SQL doesn't handle binary types. The XF augmented SQL scripts and processes the BINARY_UPDATE statement to allow binary values to be encoded to and from text.

FieldType as DAO.DataTypeEnum

The DAO Field DataTypeEnum

val as Variant

The variant value to be formatted

Optional MssqlMode as Boolean = False

Script values for MSSQL script compatability rather than JET. Booleans will be scripted to bit, MSSQL date delimiters will be used.

Call Template:

Dim s As String
s = xf.Scripter.SqlFormatFieldVal(FieldType, val)
s = xf.Scripter.SqlFormatFieldVal(FieldType, val, MssqlMode)

See Also:

Example 1:

Debug.Print SqlFormatFieldVal(dbBoolean, True)
Contact Us :: About Us :: Policies :: email: infspamo@arrospamw-of-tispamme.com    © 2012 Arrow Of Time Pty Ltd