Group:  Microsoft Access ยป microsoft.public.access.modulescoding
Thread: Importing data from a Legacy Database

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Importing data from a Legacy Database
HardlyNoticable 06.02.2006 12:47:27
Hi There,

I'm trying to import data from a legacy database in to the database of the
new application that I am creating. I want to accomplish this by building a
INTO query and will apply the query to convert the data over at launch time,
ensuring that the new database is converted using the most current data.

The new database uses a couple of different types to store data. Also,
there are a couple of columns where the data is stored with formatting
(telephone numbers) and I want to remove the formatting. I've seen a couple
of examples of vbscript functions used within a query (eg. the age functions
on this page: http://support.microsoft.com/default.aspx?scid=kb;EN-US;290190)
and I think that this might be what I need to do this, but I have no idea
about how to create an Access Module or how to include it in a query and I
haven't been able to find a good tutorial. Could someone point me on the
path to salvation?

Thanks,
hn.
Re: Importing data from a Legacy Database
"Pat Hartman\(MVP\)" <patsky[ at ]NoSpam.optonline.net> 07.02.2006 03:25:30
The examples are not VBScript. They are VBA. VBScript and VBA are both
separate languages with different abilities. They are both based on VB and
have a lot of similarities also. VBScript is more like a super batch file
language. You can just type instructions in a text file and execute the
text file.

To reference a userdefined VBA function in Access SQL, nothing special is
needed. Access SQL will recognize standard SQL functions, standard VBA
functions, and user created VBA functions located in the database from which
the SQL is run.

You can do simple formatting in a query. If the formatting/calculation is
more complex, you can create functions:

Select fld1, fld2, MyFunc(fld3) As Myfld3, Format(fld4, "mm/dd/yyyy") As
Myfld4, ....

MyFunc() is a function defined by you. Format() is a standard VBA function.
As you can see, there is no difference in the reference style.

"HardlyNoticable" <HardlyNoticable[ at ]discussions.microsoft.com> wrote in
message news:7240F4C5-B07D-44E9-8536-07EECA1C8B1A[ at ]microsoft.com...
[Quoted Text]
> Hi There,
>
> I'm trying to import data from a legacy database in to the database of the
> new application that I am creating. I want to accomplish this by building
> a
> INTO query and will apply the query to convert the data over at launch
> time,
> ensuring that the new database is converted using the most current data.
>
> The new database uses a couple of different types to store data. Also,
> there are a couple of columns where the data is stored with formatting
> (telephone numbers) and I want to remove the formatting. I've seen a
> couple
> of examples of vbscript functions used within a query (eg. the age
> functions
> on this page:
> http://support.microsoft.com/default.aspx?scid=kb;EN-US;290190)
> and I think that this might be what I need to do this, but I have no idea
> about how to create an Access Module or how to include it in a query and I
> haven't been able to find a good tutorial. Could someone point me on the
> path to salvation?
>
> Thanks,
> hn.


Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net