Results 1 to 15 of 15

Thread: What's the fastest way to

  1. #1

    Thread Starter
    PowerPoster JPnyc's Avatar
    Join Date
    Oct 2002
    Location
    Manhattan
    Posts
    3,015

    What's the fastest way to

    dump the entire contents of a SQL server DB into a .mdb?

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132
    In majority cases this won't be possible due to MS Access limitations: max size, types conversion, stored procs, etc, etc, etc ...

  3. #3
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,109
    It seems to me that the fastest way would be to open the db in Access, and save as an .mdb. I'm not sure that there is a significant problem with this. You can certainly open SQL Server DBs in Access, assuming you have proper permission. There may be some goofy conversion of data, but that's life.

  4. #4
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132
    Originally posted by Shaggy Hiker
    It seems to me that the fastest way would be to open the db in Access, and save as an .mdb...
    Just out of curiousity: how would you do that?
    How can you import all stored procs, triggers, sequences, etc in Access? In other words how can you import objects that have no identical (or similar) representation in Access environment?

  5. #5
    PowerPoster Dave Sell's Avatar
    Join Date
    Mar 2004
    Location
    /dev/null
    Posts
    2,961
    Originally posted by RhinoBull

    How can you import all stored procs, triggers, sequences, etc in Access? In other words how can you import objects that have no identical (or similar) representation in Access environment?
    That depends on how they will be used again in the future. Are you looking to backup a SQL db to an Access db to convert back to a SQL db later? Or are you looking for Access equivalents to the SQL objects that have no native representatino in Access?

  6. #6
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132
    I wasn't really asking those questions - I personally know the answers. I was hopping that Hiker would somehow explain what he had in mind ...

  7. #7
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    Perhaps he was just thinking of importing tables into Access and
    then saving the Access db?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  8. #8

    Thread Starter
    PowerPoster JPnyc's Avatar
    Join Date
    Oct 2002
    Location
    Manhattan
    Posts
    3,015
    Well I know there are some datatypes access has the SQL doesn't and vice versa, but I think most of what we need are chars, or nChars as they're called.

  9. #9
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,109
    I was just thinking of moving tables and some relationships. Basically, you are going from a large set to a small set. If you can't accept the loss of many features, you are bound for disappointment.

    Since he was going from larger to smaller, I assumed that the loss of those things that wouldn't migrate was already acceptable to him.

  10. #10
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132
    Originally posted by Shaggy Hiker
    I was just thinking of moving tables and some relationships. Basically, you are going from a large set to a small set. If you can't accept the loss of many features, you are bound for disappointment.

    Since he was going from larger to smaller, I assumed that the loss of those things that wouldn't migrate was already acceptable to him.
    ... HOPEFULLY ...

  11. #11

    Thread Starter
    PowerPoster JPnyc's Avatar
    Join Date
    Oct 2002
    Location
    Manhattan
    Posts
    3,015
    Thanks all. The contents of the SQL db were migrated from access, so the size shouldn't be a problem YET. The differing data types could be, but as I said I think most are nChars. I was thinking of a quick VB app that would run in windows scheduler and dump the entire SQL db into the mdb weekly. We already have backup, but this would allow the site to be back online in about 10 minutes.

  12. #12
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,109
    I'd just go with ADO, and not worry quite as much about speed. Were I to be writing that, my biggest worry would be data compatibility. The advantage of using a program to handle this is that you could do some conversion as an intermediate step for those fields where that would be important.

    Simple in code, may not be either particularly fast, or particularly robust.

  13. #13

    Thread Starter
    PowerPoster JPnyc's Avatar
    Join Date
    Oct 2002
    Location
    Manhattan
    Posts
    3,015
    Well I know basically how to write the function, just wondered if there was a batch command that I didn't know about, and one that would overwrite existing records in the mdb. I really didn't relish writing a few conditions and update or insert statements depending on the condition. I just wanted one condition that overwrites the entire table of the mdb. In other words, I'm being lazy.

  14. #14

    Thread Starter
    PowerPoster JPnyc's Avatar
    Join Date
    Oct 2002
    Location
    Manhattan
    Posts
    3,015
    So are there any special commands for this in VB that I dunno about or do I just iterate through the records the old fashioned way and use insert/update statements?

  15. #15

    Thread Starter
    PowerPoster JPnyc's Avatar
    Join Date
    Oct 2002
    Location
    Manhattan
    Posts
    3,015
    I guess not, eh?

Posting Permissions

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



Click Here to Expand Forum to Full Width