473,395 Members | 1,554 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

VB Code to BackUp Data from SQL to Access

Sir, I wish to know the Code in VB to Copy the data of all tables in the database of an SQL server to the database in ACCESS.The purpose is to keep a backup of data in another server .
Feb 2 '07 #1
3 2735
willakawill
1,646 1GB
This question might be answered better in the Access or SQL Server forums. I have copied your post to both.
Feb 3 '07 #2
ADezii
8,834 Expert 8TB
Sir, I wish to know the Code in VB to Copy the data of all tables in the database of an SQL server to the database in ACCESS.The purpose is to keep a backup of data in another server .
You can accomplish this without a single line of code via Data Transformation Services (DTS). The following code will Export/Transform all the Tables in a SQL Server Database to an existing Access Database:
__1 Programs ==> SQL Server ==> Import and Export Data ==> DTS Import/Export Wizard ==> <next>
__2 Set DataSource = Mixcrosoft OLE Provider for SQL Server.
__3 Select Database whose Tables you wish to Export ==> <next>
__4 Set Destination = Microsoft Access.
__5 Select the Access Database to copy data to (*.mdb). Filename is required. If a UserName and Password is required for Database entry, supply these values.
__6 Select Copy table(s) and view(s) from the source database. <next>
__7 Click Select all Tables and finish the Export/Transformation. All the data in your SQL Tables now reside in your pre-defined Access Database.
__8 I am by no means an expert in this area, but I think you can encapsulate all your Export setting in something called a DTS Package and basically automate the entire process. This question is more suited for the SQL Server Forum.
__9 Hope this helps and good luck.
Feb 3 '07 #3
iburyak
1,017 Expert 512MB
I can give you an instruction on how to create and schedule DTS job but I want to be sure it is a way you want to go with.
I don't want to waist my time on complicated instructions that are not going to be used at the end.

To do import from VB just create pass-through query to SQL server and then create another query that inserts result of a pass-through query to Access table.
From VB just clear or drop existing tables then execute insert query.

Good Luck.
Feb 3 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: James | last post by:
HI, I'm looking for a script that will allow users/admins to have a one click backup solution for a MYSQL Database.. 'BACK DATABASE' button, click and its done... The a restore option, that...
5
by: TThai | last post by:
Hi, Appreciated anyone who can help us with our problem. Our backup job for ROUTT database has been failing for the last 4 days. It was working fine for almost a year now. The only thing...
8
by: nek | last post by:
Greetings, Has anyone got the latest progress on this? It hit me this time on W2K running DB2 V8.1.5. It returned the following warning: D:\Temp>db2 backup db sample to \\localhost\tape0...
5
by: Gladiator | last post by:
Hai..... I have a database............ i took an online backup for tht..... After tht mistakenly i dropped the database.......... now i dont have the logs also....... now after i restore the...
13
by: NDayave | last post by:
How do, For backing up my database(Access 2000), i am trying to just back up the tables and their data, as this will save on space and allow for importing back into the actual database. I want the...
3
by: Robertf987 | last post by:
Well, I think I've described what I want to do in the title here. In the database, I have two main tables that contain the main data for the database. One for group expenditures, another for...
2
by: billalquist | last post by:
Here is what I am trying to do....I am using Access 2007. I created a form (frmEmailBudget) with a button (btnCreateBudgetBackup). This button needs to generate a backup of the active database...
11
by: limperger | last post by:
Hello everyone! At my workplace, there is a database shared by many users (not the one I have been mentioning in other posts, but a new one!!). It is a single mdb with no front or back-end copies...
61
by: arnuld | last post by:
I have created a program which creates and renames files. I have described everything in comments. All I have is the cod-duplication. function like fopen, sprint and fwrite are being called again...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.