Is it possible to make an EXE from an access form?

I would like the user to think they are using a regular winform, but in the backend I want to be able to access the database file.

Can I just use the access form and leave everything else in the background? can we make an exe from a form?

what is MDE?

+2


a source to share


2 answers


You cannot make an EXE from an access database like others have said, but you can go a long way to hide the fact that your application is written in access. For example, you can ...

  • Add custom splash screen

To do this, simply save the BMP file in the same folder as your DB and name it with the exact same file name, that is, MyDatabase.BMP. When access starts, instead of seeing the access splash screen, you'll see your own.

  • Change the taskbar icon

In your database go to Tools-Launch and change the app icon to the icon of your choice



  • Change the icon in your forms

You can change the icon on your forms from standard access to whatever you want, paste this code into the module

Option Compare Database
Option Explicit

Private Declare Function LoadImage Lib "user32" _
   Alias "LoadImageA" _
   (ByVal hInst As Long, _
   ByVal lpsz As String, _
   ByVal un1 As Long, _
   ByVal n1 As Long, _
   ByVal n2 As Long, _
   ByVal un2 As Long) _
   As Long

Private Declare Function SendMessage Lib "user32" _
   Alias "SendMessageA" _
   (ByVal hwnd As Long, _
   ByVal wMsg As Long, _
   ByVal wParam As Long, _
   lParam As Any) _
   As Long

Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long

Private Const WM_SETICON = &H80
Private Const IMAGE_ICON = 1
Private Const LR_LOADFROMFILE = &H10
Private Const SM_CXSMICON    As Long = 49
Private Const SM_CYSMICON    As Long = 50

Public Function SetFormIcon(hwnd As Long, strIconPath As String) As Boolean
    Dim lIcon As Long
    Dim lResult As Long
    Dim x As Long, y As Long

    x = GetSystemMetrics(SM_CXSMICON)
    y = GetSystemMetrics(SM_CYSMICON)
    lIcon = LoadImage(0, strIconPath, 1, x, y, LR_LOADFROMFILE)
    lResult = SendMessage(hwnd, WM_SETICON, 0, ByVal lIcon)
End Function

      

Then you can call it like shown in the OnOpen event form

SetFormIcon Me.hwnd, ("C:\Stuff\NewIcon.ico")

      

+3


a source


No. This is not possible in MS Access.



You will need to create a VB / VB.NET executable and reimplement your interface code where your data connection is pointed to on the backend of the Access database.

+1


a source







All Articles