473,881 Members | 1,755 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Running DTS package from Access

I have an Access database that has a few huge tables. It was taking
about 20 minutes per table to import them from another application. I
used the upsize wizard to put them in a SQL server database. I created
a DTS package to import the files and it runs in less than 5 minutes.
I'd like to change my macro that used transfer text to import my files
to run my DTS package. I've seen several posts regarding this, but I
don't understand enough about SQL server stuff to figure out how they
should work.
P.S. I did try to save my package as a Visual Basic file. Then I
tried to create a new module and import the .bas file into it, but I
got a compile error at the beginning of the code:
Public goPackageOld As New DTS.Package
Public goPackage As DTS.Package2
User defined type not defined.
Also I'm not sure how to execute the module (maybe RunCode from another
macro???) from my original macro.
Any help at a VERY BASIC level would be much appreciated.
Thanks

Nov 13 '05 #1
2 8109
The "User defined type not defined" error message results from a missing
reference to the Microsoft DTSPackage Library. You can select this from the
Tools menu, References in the VB Editor window.

You can use the RunCode method to execute a function (as opposed to a
subroutine). My experience is that the package code generated when saving
as Visual Basic creates subroutines (as opposed to functions). Therefore,
you may need to create a function in the module and use this function to
call the Main subroutine in the DTS generated code.

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.
"kkrizl" <kk****@co.el-dorado.ca.us> wrote in message
news:11******** **************@ o13g2000cwo.goo glegroups.com.. .
I have an Access database that has a few huge tables. It was taking
about 20 minutes per table to import them from another application. I
used the upsize wizard to put them in a SQL server database. I created
a DTS package to import the files and it runs in less than 5 minutes.
I'd like to change my macro that used transfer text to import my files
to run my DTS package. I've seen several posts regarding this, but I
don't understand enough about SQL server stuff to figure out how they
should work.
P.S. I did try to save my package as a Visual Basic file. Then I
tried to create a new module and import the .bas file into it, but I
got a compile error at the beginning of the code:
Public goPackageOld As New DTS.Package
Public goPackage As DTS.Package2
User defined type not defined.
Also I'm not sure how to execute the module (maybe RunCode from another
macro???) from my original macro.
Any help at a VERY BASIC level would be much appreciated.
Thanks
Nov 13 '05 #2
Selecting the reference, and creating the function to call the Main
subroutine worked perfectly! Thanks!!!

Nov 13 '05 #3

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

Similar topics

0
2172
by: Peter Weidner | last post by:
Hello friends I have a problem with UTL_File under Oracle 9.2i there - operating system Windows 2000 Professional. Following: I have a procedure in a Package, that reads from an Utl_File and also passes out something into an Utl_File again. Until this Package as well as this procedure perfectly worked two weeks ago. Then however I had a Crash on my computer, I had to install everything again. From this time works my Package as well as...
5
13725
by: Jim Andersen | last post by:
Hi, I made a DTS-package and it works when I execute it manually, but when it is run by the SQL Server Agent, it fails. I have use the guide to create a maintenance plan. That doesn't work so good either. It runs Optimizations, but not integrity checks or backups (probably because integrity checks failed). The following from the log file:
4
3826
by: Thornmastr | last post by:
Good Afternoon, I need to distribute an application which includes the run time files for Access 2002. I do have the Office XP Developer CD’s. The application itself is written in VB 6 with an Access back-end. I have created a number of reports in Access and I am starting them from the Visual Basic Front End. However, I have a number of users who do not have a copy of Access which means they will obviously need the run time files. ...
6
6350
by: tdmailbox | last post by:
I developed an access database in access 2003(keeping my database in the access 2000 format). It has been fully tested to be access 2000 compatible and works great. I am trying to package the final version however and when I tell it to create a shortcut it includeds the path to access 2003 in the shortcut C:\Program Files\Microsoft Office\OFFICE11\ my client is running access 2000. I could not figure any way to change the access...
10
2576
by: shumaker | last post by:
I don't need a detailed description of a solution(although I wouldn't mind), but I am hoping someone could tell me in general the best path to go about accomplishing a task, since I don't know all the capabilities of what I have available. I can learn the details myself I think. I am trying to set this up to be as simple to use as possible since others will be importing data on a weekly or daily basis. I need to import some text files,...
8
2520
by: Shals | last post by:
Hi, I have a DTS Package created in SQL Server but the client wants to execute the DTS package from within MS Access by clicking a button. If any one can tell me how to execute that DTS from with in MS Access(VBA Code) any suggestions would be helpful. Thanks, Shal
1
2989
by: David Greenberg | last post by:
Hi We're using SqlServer 2000. I want to run a DTS using the DTSRUN command. The commmand is inside a ".bat" file which my application is running from an SQL client. No matter how I run it from the client it fails giving me the message: SQL Server does not exist or access denied
7
2206
by: alito | last post by:
Hi all, I am new to using packages to group my modules. I can't figure out how to run a module that uses relative imports without writing a wrapper that imports that module. Everything I try it complains that I am attempting a relative import in a non-package. eg ~/python/testpackage$ ls config.py importer.py __init__.py
1
8155
by: =?Utf-8?B?Q2lhcmFuIE8nJ0Rvbm5lbGw=?= | last post by:
On reflection, you could possibly make the app a self extracting zip file which extracts the EXE and a settings file and then starts the app, then when you app closes, it can repack the settings file and itself into the exe. You would probably want a tool for this bit which could be in the zip too. So the app isnt single exe when running but when not running, it is. Just an idea for you to think about. Another option would possibly be to...
0
9926
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9776
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11095
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10812
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10399
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9552
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7108
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5976
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4194
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.