By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,221 Members | 1,121 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,221 IT Pros & Developers. It's quick & easy.

List of databases

P: n/a

Is it possible to get the list of databases somewhere in Access, for
example
module, or form?
I can create a text file with a code like that:
Dim CheckFile As String
CheckFile = Dir("C:\be\*.mdb")
Do Until CheckFile = ""
Open "C:\BE\FileList.txt" For Append As #1
Print #1, CheckFile
Close #1
CheckFile = Dir
Loop

Is it possible to get this information somehow in Access ?


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
> Dim CheckFile As String
CheckFile = Dir("C:\be\*.mdb")
Open "C:\BE\FileList.txt" For Append As #1
Do Until CheckFile = ""
Print #1, CheckFile
CheckFile = Dir
Loop
Close #1
The modified code above does not close then re-open the file every loop.

It should be possible to import the file generated by the code into a table,
look up "Import" in help

P
"Peter yeshew" <fr*******@abv.bg> wrote in message
news:3f*********************@news.frii.net...
Is it possible to get the list of databases somewhere in Access, for
example
module, or form?
I can create a text file with a code like that:
Dim CheckFile As String
CheckFile = Dir("C:\be\*.mdb")
Do Until CheckFile = ""
Open "C:\BE\FileList.txt" For Append As #1
Print #1, CheckFile
Close #1
CheckFile = Dir
Loop

Is it possible to get this information somehow in Access ?


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 12 '05 #2

P: n/a
http://www.mvps.org/access/api/api0001.htm contains code, donated by Ken
Getz, to directly use the Windows Common Dialog to allow a user to choose
path and file.

You can save the return values from Dir in an Access array or in an Access
table, as well as in a file as you illustrate.

Other than that, you'd need to clarify what you want to do.

Larry Linson
Microsoft Access MVP

"Peter yeshew" <fr*******@abv.bg> wrote in message
news:3f*********************@news.frii.net...

Is it possible to get the list of databases somewhere in Access, for
example
module, or form?
I can create a text file with a code like that:
Dim CheckFile As String
CheckFile = Dir("C:\be\*.mdb")
Do Until CheckFile = ""
Open "C:\BE\FileList.txt" For Append As #1
Print #1, CheckFile
Close #1
CheckFile = Dir
Loop

Is it possible to get this information somehow in Access ?


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.