Results 1 to 12 of 12
  1. #1
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Export Database as Time/Date

    Does anyone have some insight as to how to make this happen via code?

    Thanks!

    Drk.
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  2. #2
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Export Database as Time/Date

    I want it to export as 2001-03-13.mdb.. any ideas? [img]/forums/images/smilies/smile.gif[/img]

    Thanks!

    D
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Export Database as Time/Date

    Maybe if you explain what you mean by exporting a database, you'll get some answers. You can export objects from a database, but you can't export a database (and no, you can do a save as, either) from a database. so what exactly are you trying to do?
    Charlotte

  4. #4
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Export Database as Time/Date

    Hmm...

    Well, if I cant *duplicate?* or make a replica of the database daily, perhaps I can export a table as time-date? or multiple tables?

    All I really need is a daily backup of the data incase my problems re-occur... (The original programmer used strictly macros, which added a whole lot of junk to the code making it unstable.. any changes made to a report or form would result in complete data corruption...)

    Hope this clarifies a bit!

    Drk.
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  5. #5
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Winnipeg, Canada
    Posts
    109
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Export Database as Time/Date

    Hi Drk,

    My <img src=/S/2cents.gif border=0 width=15 height=15>.Forgive me for being so bold, but why would you want to do this in Access?

    On the surface, it would appear that there are many ways to do this, such as using some program to automatically zip up a current copy of the DB and to rename the zip file to a date/time name. Even a DOS batch file can do that.

    Is there some limiting factor here that we don't understand?

  6. #6
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Export Database as Time/Date

    <img src=/S/laugh.gif border=0 width=15 height=15>

    Not to worry.. bold is good! <img src=/S/grin.gif border=0 width=15 height=15>

    The problem is in the user base. If I can make Access do this 'behind the scenes' that would be preferrable. Because a DOS batch file or other outside resource requires another file, My concern is that it wont work if changes are made to file locations, etc..etc..etc... There's also a security factor.. although anyone can get the data if they want it, I don't want to blatently announce the locations of the data by writing a batch file, as the data is sensitive.

    Hope that helps!

    Drk.
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  7. #7
    Lounger
    Join Date
    Feb 2001
    Location
    TX, USA
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Export Database as Time/Date

    Just a thought.

    Just prior to the Application.Quit, (using code, of course) open up another .mdb file which would contain the copydb code. You can then fire the code in the open event of the startup form (or autoexec macro, if you must). Be sure to check for the abscence of the matching .ldb to ensure noone else is using the mdb (thereby possibly losing data among other problems)

  8. #8
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Export Database as Time/Date

    First i'd need to know how to do this, what would be the best way to, within access, backup my data as Time/Date? [img]/forums/images/smilies/smile.gif[/img]

    Thanks!
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  9. #9
    Lounger
    Join Date
    Feb 2001
    Location
    TX, USA
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Export Database as Time/Date

    The easiest would be, (in access) run a shell command such as the following:
    Shell "crogram fileswinzipwinzip32.exe -min -a " & fullPathAndFilenameToCreate & " " & fullPathAndFilenameToZip
    which would create a.zip file containing the .mdb and name it whatever name you assign to the fullPathAndFilenameToCreate variable
    This assumes you have a liscenced copy of winzip in the difined location

  10. #10
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Export Database as Time/Date

    I want to do this within access, without the use of winzip.. Because this is a network app, and Winzip is always on the local machine, it would be impossible to specify the correct location of Winzip on each computer...

    Does anyone have any idea how to do this in Access? <img src=/S/bow.gif border=0 width=15 height=15>

    Drk.
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  11. #11
    Lounger
    Join Date
    Feb 2001
    Location
    TX, USA
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Export Database as Time/Date

    I was trying to hold out on you, but....

    FileCopy varOriginationMDB, varDestinationMDB

    or

    FileCopy varOriginationMDB, varDestinationLocation & "" & format("yyyy-dd-mm",Date()) & ".mdb"

    both should work

    Good luck

  12. #12
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Winnipeg, Canada
    Posts
    109
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Export Database as Time/Date

    Hi Drk,

    I tried it copying a specific table to another mdb. Try this bit of code:

    Sub CopyTable()
    Dim NewTableName As String
    Dim OldTableName As String
    Dim myDestinationDB As String

    myDestinationDB = "F:KenMAccessDevTestDB.mdb"
    NewTableName = "tblRecov_" & Now()
    OldTableName = "tblRecov_Bak"

    With Application
    .DoCmd.CopyObject , NewTableName, acTable, OldTableName
    .DoCmd.TransferDatabase acExport, "Microsoft Access", myDestinationDB, acTable, NewtableName, NewtableName, 0, True
    .DoCmd.DeleteObject acTable, NewtableName
    End With
    End Sub
    Attached Images Attached Images

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •