![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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 |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
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. |
![]() |
| Thread Tools | |
| Display Modes | |
| |