is it possible to make an EXE out of an access form?
i would like the user to think he's using a regular winform, but in the backend i want to have access handle the DB stuff.
is it pos开发者_Python百科sible to just use the access form and have everything else disappear in the background? can we make an exe out of the form?
what is MDE?
You cant make an EXE out of an access database as others have said but you can go a long way to hiding the fact that your application is written in access. For example you can…
- Add a custom splash screen
To do that just save a BMP file in the same folder as your DB and call it exactly the same file name i.e. MyDatabase.BMP. When access launches instead of seeing the access splash screen you will see your custom one.
- Change the taskbar icon
On your database go to Tools-Startup and change the Application Icon to an icon of your choice
- Change the icon on your forms
You can change the icon on your forms from the standard access one to anything you like, paste this code into a 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 this on the forms OnOpen event
SetFormIcon Me.hwnd, (“C:\Stuff\NewIcon.ico")
No. That is not possible in MS Access.
You would need to create a VB/VB.NET executable and re-implement your UI code there, with your data connection pointing at the Access database backend.
精彩评论