Microsoft KB Archive/321106

= HOW TO: Create a Function That Determines If Your Application Is Running in the Retail or Run-Time Version of Access 2000 =

Article ID: 321106

Article Last Modified on 10/26/2002

-

APPLIES TO


 * Microsoft Office 2000 Developer Edition

-



This article was previously published under Q321106



For a Microsoft Office 97 Developer Edition version of this article, see 103182.

IN THIS TASK
SUMMARY
 * Code to Determine If Application Is in Run-Time



SUMMARY
This article demonstrates how to use a function to determine if your Microsoft Access application is running in the run-time or the retail version of Microsoft Access. You can use this function to prevent your application from using the retail version of Microsoft Access.

back to the top

Code to Determine If Application Is in Run-Time
  Add the following function to a new or existing module in your application, and name it IsRuntime: Function IsRuntime

On Error GoTo ErrIsRuntime IsRuntime = SysCmd(6)

ByeIsRuntime: Exit Function

ErrIsRuntime: If (Err = 5) Then IsRuntime = False Else Error Err End If  Resume ByeIsRuntime End Function   Create the following macro and name it AutoExec:   Macro Name   Condition         Action -  AutoExec     Not IsRuntime   MsgBox ...              Quit

AutoExec Action Arguments ---  MsgBox Message: Invalid setup, run  setup and try again Beep: Yes Type: Critical Title:  

back to the top

Additional query words: ACC2000 MOD2000

Keywords: kbhowto kbhowtomaster KB321106

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.