473,385 Members | 1,798 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,385 software developers and data experts.

What would be the best aproach?

Hi All,

I have a task at hand and I am trying to plan out how I should approach it.

I can use either VS.NET 2003 or 2005

I need to grab data out of an Access 97 db and push it to SQL Server 2000.

I intend on developing a standalone Windows app that sits on the same
computer where the Access db resides.

I was thinking I would use a datareader to grab the data. Can I then
directly push the data into the SQL Server db?

Any thoughts will be appreciated.

May 8 '06 #1
2 1006
Use VS 2005 if you have a choice; .Net 2.0 is much improved.

As for the data import.. SQL server can do that without the need for
you to create a program. Import the data, then, if needed, use T-Sql
to put it into another table structure / correct the data.

You can write your own program though, and yes you'd use the DataReader
to read from Access; you could use SqlCommand to call procedures or ad
hoc Sql to insert the data into Sql Server.

May 8 '06 #2
Hi,
"Frank" <fk******@pfmail.com> wrote in message
news:um**************@TK2MSFTNGP04.phx.gbl...
Hi All,

I have a task at hand and I am trying to plan out how I should approach
it.

I can use either VS.NET 2003 or 2005
Does not matter really, not for the task in hand
I need to grab data out of an Access 97 db and push it to SQL Server
2000.

I intend on developing a standalone Windows app that sits on the same
computer where the Access db resides.
Also worth considering is a console app
I was thinking I would use a datareader to grab the data. Can I then
directly push the data into the SQL Server db?


A MUCH better approach would be to use DTS, you can define your package in
enterprise manager, save it to disk and then just call it from code, this
has the added benefit to take care of any transformation of the data
needed..
Having a dataset created is not a good idea here.

Use this code to execute a DTS

using DTS;

void RunPackage( string packSource, string packName, string dataSource)
{
try
{
Package2Class package = new Package2Class();
object pVarPersistStgOfHost = null;

// if you need to load from file
package.LoadFromStorageFile(
packSource,
null,
null,
null,
packName,
ref pVarPersistStgOfHost);

package._Package_Connections.Item(1).DataSource = dataSource; // the SQL
conn string
package.Execute();
package.UnInitialize();

// force Release() on COM object
//
System.Runtime.InteropServices.Marshal.ReleaseComO bject(package);
package = null;
}
May 8 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
by: darwinist | last post by:
What PHP Represents There is no shortage of complaints one could make about php as a language, and although the list does shrink with each release, some of them are inherent to the origins and...
226
by: Stephen C. Waterbury | last post by:
This seems like it ought to work, according to the description of reduce(), but it doesn't. Is this a bug, or am I missing something? Python 2.3.2 (#1, Oct 20 2003, 01:04:35) on linux2 Type...
125
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from...
28
by: Admin | last post by:
I am doing some research for a Python framework to build web applications. I have discarted Zope because from what I've read, the learning curve is too steep, and it takes more time to build...
6
by: Mark Broadbent | last post by:
this might sound like an obvious question but I have found that usually these two evolve at the same time. One of the biggest reasons for creating the abstraction in the first place (in my...
2
by: Manny | last post by:
Hello I'm fairly new to ASP.NET and need your advice, I need to display monthly/weekly table information on the same page. The user should be able to select first from a month (from a month link...
4
by: M O J O | last post by:
Hi, I need a lillte guidance on how to create a simple component and put in in the toolbox. Here's how I've done so far, please let me know if there's a better aproach (I have some question...
3
by: Rob | last post by:
Rather new to vb.net... I am wondering if the following is possible and sounds reasonable... Can connection objects and datasets be defined once (at program load) and be available for the life...
6
by: jhooper71 | last post by:
It's been recommended to me to use a webservice and XML for the data manipulation layer for web applications in .NET 1.1. I was thinking I could use the web service to extend the database...
3
by: Andy B | last post by:
I noticed when I compiled a web application project in vs2008 earlier that it leaves some project files around like compile object files, some uncompiled DataSets and some uncompiled web.config...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.