Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting Access db into exe?

Status
Not open for further replies.

Bokazoit

Technical User
Sep 16, 2004
73
0
0
DK
I have seen on forums by searching for this, that it's possible to somehow convert my database into a executable application. But the procedure to do so seems tricky or not very understandable.

I have my databse with tables, queries and Report. Finally an access Macro (And yes, not the best but I can't do vb) So how can I make my database executable or do You know of a way to do it easy and how to make it use the macro created?

If You know how, can You make an example of how to do this with a access database where the access-macro asks for a period (number) and then returns a report based on that period.

I know I have to learn vb sometime but this isn't the time :/
 
Bokazoit,

It is possible to convert your database to an executable file but it won't have the exe extension. Access has a tool, under its tools menu, that allows you to compile and package your db but it will have the mde extension.

This means that you will still need to have installed Access in your computer in order to run this mde file. Your db will become an application running under ACcess. Similar to Access having to run under Windows.

To convert your database to an MDE to this;

1. Go to menu and clickon tools.
2. Then click on database utilities and ..
3. then Make MDE file

I hope this helps

V.
 
Well I don't see any difference. I mean what does the mde extension have of impact on my database?

And the Macro I have I would like to be able to run as a sort of application without having the GUI of Access open is that possible?
 
I explain myself very! badly sorry for that. What I mean is that I have this macro (created in Access) and it asks for a period and then runs all the queries needed. Then it opens the report and exits Access. So in a way me collegues only need to answer the question about the period and then see the report.

Is that possible? :)
 
Name your macro autoexec, it will start directly when you open the access MDB or MDE file
 
Wohooo! :D

Nice...Can I remove the background GUI? I mean Access GUI so that only I see the pop asking for a period?
 
Ok let me ask in another way. I have found this code...But gives me an error here:

Public Function ChangeProperty(strPropName As String, varPropType As Variant, varPropValue As Variant) As Integer
Dim dbs As Database, prp As Property
Const conPropNotFoundError = 3270


Below I pasted all code but since I don't know anything about VB I hope You can help. The code should remove GUI when I run a macro :)

Sub SetStartupProperties()
ChangeProperty "StartupForm", dbText, "YourFormHere"
ChangeProperty "StartupShowDBWindow", dbBoolean, False
ChangeProperty "StartupShowStatusBar", dbBoolean, False
ChangeProperty "AllowBuiltinToolbars", dbBoolean, False
ChangeProperty "AllowFullMenus", dbBoolean, False
ChangeProperty "AllowBreakIntoCode", dbBoolean, False
ChangeProperty "AllowSpecialKeys", dbBoolean, False
ChangeProperty "AllowBypassKey", dbBoolean, False
ChangeProperty "AppTitle", dbText, "Application Title Here vs1.2"
Application.RefreshTitleBar
End Sub

Public Function ChangeProperty(strPropName As String, varPropType As Variant, varPropValue As Variant) As Integer
Dim dbs As Database, prp As Property
Const conPropNotFoundError = 3270

Set dbs = CurrentDb
On Error GoTo Change_Err
dbs.Properties(strPropName) = varPropValue
ChangeProperty = True

Change_Bye:
Exit Function

Change_Err:
If ERR = conPropNotFoundError Then ' Property not found.
Set prp = dbs.CreateProperty(strPropName, _
varPropType, varPropValue)
dbs.Properties.Append prp
Resume Next
Else
' Unknown error.
ChangeProperty = False
Resume Change_Bye
End If
End Function
 
Won't fix the error, but the various arg values need to be replaced with items from YOUR application. e.g.:

"YourFormHere" needs to be revised to reflect SOME form name in your application. Presumably the form where you (users) enter the dates?

Unfortunatly it appears that this will ALSO make the overall app VERY Difficult to work with, particularly any debugging which might be necessary.

The actual error(s) MAY be gfenerated from some of the porperty settings. Ms. A. doesn' necessarily have all of the listed properties, depending on the ver and previous set up issues. In particular, ""AllowBreakIntoCode"" and "AllowBypassKey" aren't usually present unless thay have been (previously) created. Simply commenting these out (place a single quote at the beginning of the lines where they appear) MIGHT make it work. To make the 'whole thing' work, you should have something (code / macro) which checks both values are entered and that they are 'reasonable' before quitting the app.





MichaelRed


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top