|
security
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
type mismatch and allowbypasskeyHello:
I am getting a type mismatch error at Set prop = db.CreateProperty("AllowByPassKey", _ dbBoolean, False) for either of the solutions at http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html http://support.microsoft.com/kb/826765#appliesto would anyone know how to resolve this problem? thanks Harvey How have you declared prop?
You're using DAO, so you need Dim prop As DAO.Property -- Show quoteHide quoteDoug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "Harvey" <Har***@discussions.microsoft.com> wrote in message news:CBDE1D4C-AAB6-4475-843D-F88CC2F7CE9E@microsoft.com... > Hello: > > I am getting a type mismatch error at > > Set prop = db.CreateProperty("AllowByPassKey", _ > dbBoolean, False) > > for either of the solutions at > > http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html > http://support.microsoft.com/kb/826765#appliesto > > would anyone know how to resolve this problem? > > thanks > Harvey Hello Douglas:
Yes, that declaration is present in both sets of code, e.g. the MS sample code below: Function ap_DisableShift() 'This function disable the shift at startup. This action causes 'the Autoexec macro and Startup properties to always be executed. On Error GoTo errDisableShift Dim db As DAO.Database Dim prop As Property Const conPropNotFound = 3270 Set db = CurrentDb() 'This next line disables the shift key on startup. db.Properties("AllowByPassKey") = False 'The function is successful. Exit Function errDisableShift: 'The first part of this error routine creates the "AllowByPassKey 'property if it does not exist. If Err = conPropNotFound Then Set prop = db.CreateProperty("AllowByPassKey", _ dbBoolean, False) db.Properties.Append prop Resume Next Else MsgBox "Function 'ap_DisableShift' did not complete successfully." Exit Function Show quoteHide quote "Douglas J. Steele" wrote: > How have you declared prop? > > You're using DAO, so you need > > Dim prop As DAO.Property > > -- > Doug Steele, Microsoft Access MVP > http://I.Am/DougSteele > (no private e-mails, please) > > > "Harvey" <Har***@discussions.microsoft.com> wrote in message > news:CBDE1D4C-AAB6-4475-843D-F88CC2F7CE9E@microsoft.com... > > Hello: > > > > I am getting a type mismatch error at > > > > Set prop = db.CreateProperty("AllowByPassKey", _ > > dbBoolean, False) > > > > for either of the solutions at > > > > http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html > > http://support.microsoft.com/kb/826765#appliesto > > > > would anyone know how to resolve this problem? > > > > thanks > > Harvey > > > Hello Douglas:
yes, I took this code verbatim from the sample code in the links below, and the declaration is indeed present (see code below). any other Ideas? I tried various substitutions and no luck. Function ap_DisableShift() 'This function disable the shift at startup. This action causes 'the Autoexec macro and Startup properties to always be executed. On Error GoTo errDisableShift Dim db As DAO.Database Dim prop As Property Const conPropNotFound = 3270 Set db = CurrentDb() 'This next line disables the shift key on startup. db.Properties("AllowByPassKey") = False 'The function is successful. Exit Function errDisableShift: 'The first part of this error routine creates the "AllowByPassKey 'property if it does not exist. If Err = conPropNotFound Then Set prop = db.CreateProperty("AllowByPassKey", _ dbBoolean, False) db.Properties.Append prop Resume Next Else MsgBox "Function 'ap_DisableShift' did not complete successfully." Exit Function Show quoteHide quote "Douglas J. Steele" wrote: > How have you declared prop? > > You're using DAO, so you need > > Dim prop As DAO.Property > > -- > Doug Steele, Microsoft Access MVP > http://I.Am/DougSteele > (no private e-mails, please) > > > "Harvey" <Har***@discussions.microsoft.com> wrote in message > news:CBDE1D4C-AAB6-4475-843D-F88CC2F7CE9E@microsoft.com... > > Hello: > > > > I am getting a type mismatch error at > > > > Set prop = db.CreateProperty("AllowByPassKey", _ > > dbBoolean, False) > > > > for either of the solutions at > > > > http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html > > http://support.microsoft.com/kb/826765#appliesto > > > > would anyone know how to resolve this problem? > > > > thanks > > Harvey > > > Hate to say it, but the sites are wrong then.
The code you've posted says Dim prop As Property As I said in my original response, that needs to be Dim prop As DAO.Property -- Show quoteHide quoteDoug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "Harvey" <Har***@discussions.microsoft.com> wrote in message news:EAE001E8-4256-495A-98BE-F6237091B44F@microsoft.com... > Hello Douglas: > > yes, I took this code verbatim from the sample code in the links below, > and > the declaration is indeed present (see code below). any other Ideas? I > tried various substitutions and no luck. > > > > Function ap_DisableShift() > 'This function disable the shift at startup. This action causes > 'the Autoexec macro and Startup properties to always be executed. > > On Error GoTo errDisableShift > > Dim db As DAO.Database > Dim prop As Property > Const conPropNotFound = 3270 > > Set db = CurrentDb() > > 'This next line disables the shift key on startup. > db.Properties("AllowByPassKey") = False > > 'The function is successful. > Exit Function > > errDisableShift: > 'The first part of this error routine creates the "AllowByPassKey > 'property if it does not exist. > If Err = conPropNotFound Then > Set prop = db.CreateProperty("AllowByPassKey", _ > dbBoolean, False) > db.Properties.Append prop > Resume Next > Else > MsgBox "Function 'ap_DisableShift' did not complete successfully." > Exit Function > > > > > "Douglas J. Steele" wrote: > >> How have you declared prop? >> >> You're using DAO, so you need >> >> Dim prop As DAO.Property >> >> -- >> Doug Steele, Microsoft Access MVP >> http://I.Am/DougSteele >> (no private e-mails, please) >> >> >> "Harvey" <Har***@discussions.microsoft.com> wrote in message >> news:CBDE1D4C-AAB6-4475-843D-F88CC2F7CE9E@microsoft.com... >> > Hello: >> > >> > I am getting a type mismatch error at >> > >> > Set prop = db.CreateProperty("AllowByPassKey", _ >> > dbBoolean, False) >> > >> > for either of the solutions at >> > >> > http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html >> > http://support.microsoft.com/kb/826765#appliesto >> > >> > would anyone know how to resolve this problem? >> > >> > thanks >> > Harvey >> >> >> Right you are - problem solved. thank you Douglas.
Show quoteHide quote "Douglas J. Steele" wrote: > Hate to say it, but the sites are wrong then. > > The code you've posted says > > Dim prop As Property > > As I said in my original response, that needs to be > > Dim prop As DAO.Property > > -- > Doug Steele, Microsoft Access MVP > http://I.Am/DougSteele > (no private e-mails, please) > > > "Harvey" <Har***@discussions.microsoft.com> wrote in message > news:EAE001E8-4256-495A-98BE-F6237091B44F@microsoft.com... > > Hello Douglas: > > > > yes, I took this code verbatim from the sample code in the links below, > > and > > the declaration is indeed present (see code below). any other Ideas? I > > tried various substitutions and no luck. > > > > > > > > Function ap_DisableShift() > > 'This function disable the shift at startup. This action causes > > 'the Autoexec macro and Startup properties to always be executed. > > > > On Error GoTo errDisableShift > > > > Dim db As DAO.Database > > Dim prop As Property > > Const conPropNotFound = 3270 > > > > Set db = CurrentDb() > > > > 'This next line disables the shift key on startup. > > db.Properties("AllowByPassKey") = False > > > > 'The function is successful. > > Exit Function > > > > errDisableShift: > > 'The first part of this error routine creates the "AllowByPassKey > > 'property if it does not exist. > > If Err = conPropNotFound Then > > Set prop = db.CreateProperty("AllowByPassKey", _ > > dbBoolean, False) > > db.Properties.Append prop > > Resume Next > > Else > > MsgBox "Function 'ap_DisableShift' did not complete successfully." > > Exit Function > > > > > > > > > > "Douglas J. Steele" wrote: > > > >> How have you declared prop? > >> > >> You're using DAO, so you need > >> > >> Dim prop As DAO.Property > >> > >> -- > >> Doug Steele, Microsoft Access MVP > >> http://I.Am/DougSteele > >> (no private e-mails, please) > >> > >> > >> "Harvey" <Har***@discussions.microsoft.com> wrote in message > >> news:CBDE1D4C-AAB6-4475-843D-F88CC2F7CE9E@microsoft.com... > >> > Hello: > >> > > >> > I am getting a type mismatch error at > >> > > >> > Set prop = db.CreateProperty("AllowByPassKey", _ > >> > dbBoolean, False) > >> > > >> > for either of the solutions at > >> > > >> > http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html > >> > http://support.microsoft.com/kb/826765#appliesto > >> > > >> > would anyone know how to resolve this problem? > >> > > >> > thanks > >> > Harvey > >> > >> > >> > > >
Other interesting topics
.mdb file is read only...
expressions blocked inconsistently Encrypt only Back-End in Split DB Ping Chris O'C How to hide database window in Access 2007 Multi-User input and db protection create login screen with db2 Unknown Publisher Installing DB on a server/accessing it from a client PC AllowBypassKey and Type Mismatch Error |
|||||||||||||||||||||||