Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Converting a SQL Server 2000 Database to Access 97

Posted on 2002-07-19
6
Medium Priority
?
133 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 17

Accepted Solution

by:
inthedark earned 400 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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
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…
Suggested Courses

971 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