Solved

Converting a SQL Server 2000 Database to Access 97

Posted on 2002-07-19
6
129 Views
Last Modified: 2010-05-02
Hello All

Is anyone aware whether it is possible in VB code to convert just the data tables of a SQL Server 2000 database to a Access 97 mdb file.

I wish to use a small-subset of the SQL Server database in a Access 97 format.

I look forward to a reply.

Many Thanks

Asif Mughal
0
Comment
Question by:AsifMughal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 3

Expert Comment

by:ketapillar
ID: 7165786
Use the DTS...  You can copy the data over to the other tables however some of the fields (Primary Keys will no longer be primary keys).

Enterprise Manager...

Right click on database.. choose "All Tasks -> Export" Follow the wizard.

Oh you need to create a blank access 97 database before you run it.
0
 
LVL 3

Expert Comment

by:ketapillar
ID: 7165792
Keep in mind that the stored procedures will not transfer over.  I do this with an Access 2k database however it's a dump of the tables and table data.

More than likely you will get a few errors when you run it the first couple of times... if you need help with one just tell me what the error message is....
0
 

Author Comment

by:AsifMughal
ID: 7166518
I am aware you can do this via DTS using the Enterprise but I need to do this via code, as I am using a mini version of SQL Server (MSDE).  

I would like the user to click a button and it should automaitcally do this.
0
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
LVL 17

Accepted Solution

by:
inthedark earned 100 total points
ID: 7167267
The problem with DTS is the indexs. Also you have a problem with Access you can only add records to a table with auto-increment if the tables empty.

So here is the process in ADO:

1) Create the destination MDB file
2) Get list of tables in SQL database
3) Open each table e.g. Select * from [table1];
4) Create a tables in the destination database
5) Use ADOX to create the keys and indexs in the mDB file.
7) For each table create a dummy table with no indexes and use longs instead of autoincrement fields.
8) Loop through source records and save the data in the desintation database
9) The use Select * Into Table1 from [dummyTable1]; to move the data into the finale table.

If you need help with any of these bits let me kniw.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 8031870
Hi AsifMughal,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept inthedark's comment(s) as an answer.

AsifMughal, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 

Expert Comment

by:SpideyMod
ID: 8095537
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month11 days, 2 hours left to enroll

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question