dbTalk Databases Forums  

External CodeProject

comp.databases.ms-access comp.databases.ms-access


Discuss External CodeProject in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
christianlott1@yahoo.com
 
Posts: n/a

Default External CodeProject - 10-05-2011 , 10:11 PM






How to connect to an external access db codeproject for cataloging
it's forms queries and reports?

There is a CurrentProject and a CodeProject which leads me to believe
it's possible - or am I wrong?

Dim cp as CodeProject

Set cp = New codeproject.openconnection("C:\db.mdb")





Thanks

Reply With Quote
  #2  
Old   
Access Developer
 
Posts: n/a

Default Re: External CodeProject - 10-06-2011 , 12:51 PM






Help me understand what you mean by "catalogging its forms, queries, and
reports", as you can examine and/or retrieve those objects without
"conecting to a codeproject". It's always a good idea to state what you are
trying to accomplish rather than how you think it ought to be accomplished,
because someone may have a useful suggestion.

--
Larry Linson, Microsoft Office Access MVP
Co-author: "Microsoft Access Small Business Solutions", published by Wiley
Access newsgroup support is alive and well in USENET
comp.databases.ms-access


<christianlott1 (AT) yahoo (DOT) com> wrote

Quote:
How to connect to an external access db codeproject for cataloging
it's forms queries and reports?

There is a CurrentProject and a CodeProject which leads me to believe
it's possible - or am I wrong?

Dim cp as CodeProject

Set cp = New codeproject.openconnection("C:\db.mdb")





Thanks

Reply With Quote
  #3  
Old   
christianlott1@yahoo.com
 
Posts: n/a

Default Re: External CodeProject - 10-06-2011 , 01:52 PM



I'm working on a project originally put together by someone else.
Instead of making a single db, they have made a single db for each
company. They copy a db template then make minor tweaks to the reports
and queries in each db.

So, I'm trying to consolidate. Since most of the reports and queries
are the same - instead of opening each of them and looking for
anomalies - I'd like to use SaveAsText to export them all into unique
folders then import them all into a db table to compare and match
them.

Never mind though, I got it working:

Dim dbs As DAO.Database
Dim cnt As DAO.Container
Dim doc As DAO.Document

Dim app As Access.Application
Set app = New Access.Application

app.OpenCurrentDatabase ("C:\Documents and Settings\blah\Desktop
\extract4.accdb")

Set dbs = app.CurrentDb()

Set cnt = dbs.Containers("Forms")
For Each doc In cnt.Documents
app.SaveAsText acForm, doc.Name, "C:\Documents and Settings\blah
\Desktop\" & doc.Name & ".txt"
Next doc

For i = 0 To dbs.QueryDefs.Count - 1
Application.SaveAsText acQuery, dbs.QueryDefs(i).Name, "D:\Document
\" & dbs.QueryDefs(i).Name & ".txt"
Next i

Modified Code from http://www.datastrat.com/Code/DocDatabase.txt

I'm going to have to change the last statement to read the SQL text
and append it to a table

dbs.QueryDefs(i).SQL

and also load those report docs from file into a table too.

This would have been a PITA if I couldn't do this.

Would there be a better way to do all this? Maybe importing system
tables? I don't think they hold report design data though or the
entire SQL strings.

Reply With Quote
  #4  
Old   
Access Developer
 
Posts: n/a

Default Re: External CodeProject - 10-06-2011 , 04:08 PM



Glad to hear you made it work -- that's the goal, make it work correctly.

--
Larry Linson, Microsoft Office Access MVP
Co-author: "Microsoft Access Small Business Solutions", published by Wiley
Access newsgroup support is alive and well in USENET
comp.databases.ms-access


<christianlott1 (AT) yahoo (DOT) com> wrote

Quote:
I'm working on a project originally put together by someone else.
Instead of making a single db, they have made a single db for each
company. They copy a db template then make minor tweaks to the reports
and queries in each db.

So, I'm trying to consolidate. Since most of the reports and queries
are the same - instead of opening each of them and looking for
anomalies - I'd like to use SaveAsText to export them all into unique
folders then import them all into a db table to compare and match
them.

Never mind though, I got it working:

Dim dbs As DAO.Database
Dim cnt As DAO.Container
Dim doc As DAO.Document

Dim app As Access.Application
Set app = New Access.Application

app.OpenCurrentDatabase ("C:\Documents and Settings\blah\Desktop
\extract4.accdb")

Set dbs = app.CurrentDb()

Set cnt = dbs.Containers("Forms")
For Each doc In cnt.Documents
app.SaveAsText acForm, doc.Name, "C:\Documents and Settings\blah
\Desktop\" & doc.Name & ".txt"
Next doc

For i = 0 To dbs.QueryDefs.Count - 1
Application.SaveAsText acQuery, dbs.QueryDefs(i).Name, "D:\Document
\" & dbs.QueryDefs(i).Name & ".txt"
Next i

Modified Code from http://www.datastrat.com/Code/DocDatabase.txt

I'm going to have to change the last statement to read the SQL text
and append it to a table

dbs.QueryDefs(i).SQL

and also load those report docs from file into a table too.

This would have been a PITA if I couldn't do this.

Would there be a better way to do all this? Maybe importing system
tables? I don't think they hold report design data though or the
entire SQL strings.



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.