|
-
February 3rd, 2000, 10:38 AM
#1
Files (Urgent)
Does any body have any sample code to loop through a set of Access tables within a certain directory? I need to be able to loop through all the access tables in the given directory and make changes to certain fields within each table.
Thanks
-
February 3rd, 2000, 10:44 AM
#2
Re: Files (Urgent)
all access tables inside a database are stored withÃ*n a single MDB file.
Thus, after you open it using Opendatabase you can iterate over the tabledefs collection to access all tables in the database.
-
February 3rd, 2000, 11:09 AM
#3
Re: Files (Urgent)
First, tables are in a database, databeses are in a dir.
If you got multiple tables in one database, use the tabledef to go through them, if you got more databases in one directory, use the dir command.
myDbFile = dir("path","*.mdb")
do while myDbFile <> ""
data1.databasename = myDbFile
data1.recordsource = "name_of_tabel"
data1.recordset.refresh
data1.recordset.movefirst
do while not(data1.recordset.eof)
with data1.recordset
.edit
.fields!field_to_modify = "new_value"
.update
.movenext
end with
loop
'check if there are anymore databases to process in the directory
myDbFile = dir
loop
Tom Cannaerts
[email protected]
-
February 3rd, 2000, 12:38 PM
#4
Re: Files (Urgent)
Wow!!! Thanks a mill. guys!!!! I'll try it out....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|