Compact lots & lots of databases!! .... hmm 
Author Message
 Compact lots & lots of databases!! .... hmm

Hello,

I have a plan ...... and MSAccess97 & WinNT4.0 .... I would like to do the
following:
- have a table called dbs with 3 fields (dbID dbfolder dbname)
- have a form called f_dbs bound to the table dbs with 2 text fields
(dbfolder dbname) bound to their respective fields in the underlying table
in the detail section of the form .... have a cmdbutton called cmd_compact
in the form header section with an event procedure which would loop through
all the values stored in the table dbs and compact the various databases
specified through those values.

I have the following procedure for the moment:
Function Macro1()
On Error GoTo Macro1_Err

    Dim dbfolder As String
    Dim dbname As String

    DoCmd.RunCommand acCmdCompactDatabase

Macro1_Exit:
    Exit Function

Macro1_Err:
    MsgBox Error$
    Resume Macro1_Exit

End Function

(as you may notice, I converted a macro to VBA :-) ...)

anyway, I would like to pass the values from the table dbs (well, actually
at first I wanted to do it from the values in the fields on an unbound form
... but then I thought about the table!) to the cmdCompactdatabase command
... how do I do that? it doesn't seem to accept the values and I can't
figure out a workaround ....

can anyone help me? ... it this possible in the first place?

Thanks in advance,

L



Sat, 06 Mar 2004 01:52:40 GMT  
 Compact lots & lots of databases!! .... hmm

Quote:

>     DoCmd.RunCommand acCmdCompactDatabase
> anyway, I would like to pass the values from the table dbs (well,
> actually at first I wanted to do it from the values in the fields on an
> unbound form ... but then I thought about the table!) to the
> cmdCompactdatabase command ... how do I do that? it doesn't seem to
> accept the values and I can't figure out a workaround ....

Look up CompactDatabase and OpenRecordset in help.  Use OpenRecordset to set
up a loop where you can read each row from the table, and call
CompactDatabase for each value.

 -- Dev



Sat, 06 Mar 2004 18:50:18 GMT  
 Compact lots & lots of databases!! .... hmm
Thanks a lot for this!
this was exactly the little pointer I needed!

thanks again,

kindest regards,

L.



Sat, 06 Mar 2004 22:57:10 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. adding lots and lots of pictures to the executable

2. Lots and Lots of Controls slow things down....

3. Lots of source code & mini projects

4. Opening a lot of database in VB4.0

5. I am looking for a used car lot database

6. Opening a lot of database in VB4.0

7. Generating lots of forms in VB from database

8. Design Pattern : Lots of members (potentially Null) or Lots of small classes?

9. Thanks a lot

10. Simple question that would help me a lot

11. Lots Of Money For Service

12. listbox fills only partially when presenting a lot of data

 

 
Powered by phpBB® Forum Software