Home Cart [Log In] About Us Contact Us

Object Reference

xf_DbConnectDatabase Access Wrapper

Public Function RunSQL (
sqlStr As String,
Optional SuppressError As Boolean = False,
Optional DebugOn As Boolean = False
) As Boolean

Run the passed SQL, returning False if an error occurred.
Uses the database Execute() method, known to be more reliable than the Docmd.RunSQL method, and supports running against databases other than the current one.

sqlStr as String

The SQL to execute

Optional SuppressError as Boolean = False

Don't display an error if it occurs, just return False

Optional DebugOn as Boolean = False

Print the SQL as part of the error message if an error occurs

Call Template:

Dim b As Boolean
b = xf.DbConnect.RunSQL(sqlStr)
b = xf.DbConnect.RunSQL(sqlStr, SuppressError, DebugOn)

See Also:

Example 1:

xf.DbConnect.RunSQL "UPDATE Products SET Price=23.4 WHERE ProductID=34"
Contact Us :: About Us :: Policies :: email: infspamo@arrospamw-of-tispamme.com    © 2012 Arrow Of Time Pty Ltd