Solved

Converting a SQL Server 2000 Database to Access 97

Posted on 2002-07-19
6
124 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
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

867 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now