extract vba code

G

g.darienzo

Hi my name is giovanni, i live in rome(ITALY)
I want ask you if is possible extract the vba code from access adp file
to a txt file.
My society wants rewrite this application and i must extract the names
of the used objects (Query name , storeprocedure name, table name) used
in the function and in the property of the application. this is
possibile?
the application don't have the password protection and the code is
visible. ;)
how I can make?

best regards
 
A

Alessandro Baraldi

(e-mail address removed) ha scritto:
Hi my name is giovanni, i live in rome(ITALY)
I want ask you if is possible extract the vba code from access adp file
to a txt file.
My society wants rewrite this application and i must extract the names
of the used objects (Query name , storeprocedure name, table name) used
in the function and in the property of the application. this is
possibile?
the application don't have the password protection and the code is
visible. ;)
how I can make?

best regards

Hi Giovanni.(i'm from Italy too Mantova)
You need to separate Forms and Module Object from
Table/Queries/View/SP/Diagram

Why you need to export also Table/Queries/SP/View wich are on Server
side...?

I presume you can need to export Forms and Module Code... this is
wrong..?

You can look for AccessObject on Help :
AllDataAccessPages
AllDatabaseDiagrams
AllForms
AllFunctions
AllMacros
AllModules
AllQueries
AllReports
AllStoredProcedures
AllTables
AllViews


This code sample provide to Export Form Code to a TextFile:

Public Sub ExportFormCode(ByVal strFormName As String, _
ByVal strTargetDir As String)

Dim lngFile As Long
lngFile = FreeFile()
Open strTargetDir & "\" & strFormName & ".bas" For Append As
lngFile

DoCmd.OpenForm strFormName, acDesign

With Forms(strFormName).Module
Print #lngFile, .Lines(1, .CountOfLines)
End With

DoCmd.Close acForm, strFormName
Close lngFile

End Sub

In this case you can cicle trought AllForms Collection class and send
each one to this
function to exports...!
The same thing about AllModules collections, but in this case you need
to modifie the
function to point to the Modules(ModuleName)

Public Sub ExportModuleCode(ByVal strModuleName As String, _
ByVal strTargetDir As String)

Dim lngFile As Long
lngFile = FreeFile()
Open strTargetDir & "\" & strModuleName & ".bas" For Append As
lngFile

DoCmd.OpenModule strModuleName

With Forms(strModuleName).Module
Print #lngFile, .Lines(1, .CountOfLines)
End With

DoCmd.Close acModule, strModuleName
Close lngFile
End Sub

And so.... good work

Sorry about any error i can't test the code...

@Alex
 
G

g.darienzo

Eccellente non ci sono parole.

Cordialmente
Giovanni D'Arienzo
..net software developer
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top