JetGetSystemParameter() public static method

Gets database configuration options.
JET_param.ErrorToString passes in the error number in the paramValue, which is why it is a ref parameter and not an out parameter.
public static JetGetSystemParameter ( JET_INSTANCE instance, JET_SESID sesid, JET_param paramid, int &paramValue, string &paramString, int maxParam ) : JET_wrn
instance JET_INSTANCE The instance to retrieve the options from.
sesid JET_SESID The session to use.
paramid JET_param The parameter to get.
paramValue int Returns the value of the parameter, if the value is an integer.
paramString string Returns the value of the parameter, if the value is a string.
maxParam int The maximum size of the parameter string.
return JET_wrn
示例#1
0
        /// <summary>
        /// Get a system parameter which is a boolean.
        /// </summary>
        /// <param name="param">The parameter to get.</param>
        /// <returns>The value of the parameter.</returns>
        private static bool GetBoolParameter(JET_param param)
        {
            int    value = 0;
            string ignored;

            Api.JetGetSystemParameter(JET_INSTANCE.Nil, JET_SESID.Nil, param, ref value, out ignored, 0);
            return(value != 0);
        }
        /// <summary>
        /// Get a system parameter which is a string.
        /// </summary>
        /// <param name="param">The parameter to get.</param>
        /// <returns>The value of the parameter.</returns>
        private static string GetStringParameter(JET_param param)
        {
            int    ignored = 0;
            string value;

            Api.JetGetSystemParameter(JET_INSTANCE.Nil, JET_SESID.Nil, param, ref ignored, out value, 1024);
            return(value);
        }
        /// <summary>
        /// Get a system parameter which is a string.
        /// </summary>
        /// <param name="param">The parameter to get.</param>
        /// <returns>The value of the parameter.</returns>
        private string GetStringParameter(JET_param param)
        {
            int    ignored = 0;
            string value;

            Api.JetGetSystemParameter(this.instance, this.sesid, param, ref ignored, out value, 1024);
            return(value);
        }
        /// <summary>
        /// Get a system parameter which is a boolean.
        /// </summary>
        /// <param name="param">The parameter to get.</param>
        /// <returns>The value of the parameter.</returns>
        private bool GetBoolParameter(JET_param param)
        {
            int    value = 0;
            string ignored;

            Api.JetGetSystemParameter(this.instance, this.sesid, param, ref value, out ignored, 0);
            return(value != 0);
        }
        /// <summary>
        /// Get a system parameter which is an IntPtr.
        /// </summary>
        /// <param name="param">The parameter to get.</param>
        /// <returns>The value of the parameter.</returns>
        private IntPtr GetIntPtrParameter(JET_param param)
        {
            IntPtr value = IntPtr.Zero;
            string ignored;

            Api.JetGetSystemParameter(this.instance, this.sesid, param, ref value, out ignored, 0);
            return(value);
        }