473,471 Members | 1,964 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Importing from different type of database

Hello

I am creating a wizard so a user can import data from other type of
databases (DBase IV, Paradox etc...) into an Access mdb.

The first step would require the user to choose the type and path of
database.
I would then like to display a list of tables in that database available for
import.

And that is where I am not quite sure how to do this especially with other
type
of databases.

With an mdb database I would use:

Set MyImpDB = DBEngine.OpenDatabase(path)
For Each defTbl in MyImpDB.TableDefs

'Get defTbl.Name and add to list box

Next defTbl
Any thoughts?
Thanks

G Gerard
Jun 7 '07 #1
1 1756
G Gerard wrote:
Hello

I am creating a wizard so a user can import data from other type of
databases (DBase IV, Paradox etc...) into an Access mdb.

The first step would require the user to choose the type and path of
database.
I would then like to display a list of tables in that database available
for import.

And that is where I am not quite sure how to do this especially with
other type
of databases.

With an mdb database I would use:

Set MyImpDB = DBEngine.OpenDatabase(path)
For Each defTbl in MyImpDB.TableDefs

'Get defTbl.Name and add to list box

Next defTbl
Any thoughts?
Thanks

G Gerard

Open the Listbox's property sheet, select Data tab, go to the Row Source
Type row, click on it, and press F1.

From help: "To set the RowSourceType property to a user-defined
function, enter the name of the function."

Look in the help doc for a user-defined function. The help topic I am
looking at is "RowSourceType Property (User-Defined Function) — Code
Argument Values". Look at the code example.

Here is one I found in the example
Function ListMDBs(fld As Control, id As Variant, row As Variant, col As
Variant, code As Variant) As Variant
Static dbs(127) As String, Entries As Integer
Dim ReturnVal As Variant
ReturnVal = Null
Select Case code
Case acLBInitialize
Entries = 0
dbs(Entries ) = Dir("*.MDB")
Do Until dbs(Entries) = "" Or Entries >= 127
Entries = Entries+1
dbs(Entries) = Dir
Loop
ReturnVal = Entries
Case acLBOpen ReturnVal = Timer Case acLBGetRowCount
ReturnVal = Entries
Case acLBGetColumnCount ' Get number of columns.
ReturnVal = 1
Case acLBGetColumnWidth ' Column width.
ReturnVal = -1
Case acLBGetValue ' Get data.
ReturnVal = dbs(row)
Case acLBEnd
Erase dbs
End Select
ListMDBs = ReturnVal
End Function

You could use the above one, except for the Initialize where you'd
change the MDB refs to tabledef names (and remove the limitation of 127
mdbs).

Now in the RowSourceType you would enter
ListMDBs
You don't precede the function with an = sign.

Jun 7 '07 #2

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

Similar topics

1
by: D Mat | last post by:
Hi, I'm trying to get MS Access 2000 to automatically import a series of (~200) flat text, tab delimited, data files into a single Access table, with consistent fields and rows. The files have...
1
by: sparks | last post by:
I have never done this and wanted to ask people who have what is the best way. One person said import it to excel, then import it into access table. but since this will be done a lot, I am...
3
by: Mark | last post by:
All, As you can see below, I have had problems with inquisitive souls looking at data they shouldn't be. I though disabling the ability to create new databases using my workgroup would stop this...
2
by: Sara | last post by:
Hi - I've been reading the posts for a solution to my query, and realize that I should ask an "approch" question as well. We receive our production data from a third party, so my uers import...
5
by: dixie | last post by:
If I sent a user an empty database container - dB with no tables and I needed them to import their tables into it and one of their tables was a hidden table with the prefix Usys, is there any way...
2
by: Snozz | last post by:
The short of it: If you needed to import a CSV file of a certain structure on a regular basis(say 32 csv files, each to one a table in 32 databases), what would be your first instinct on how to...
3
by: Sam Alexander | last post by:
Hi Everone, I'm writing a script to import data from an XML file, and this tutorial is really an awesome guide : http://www.kbalertz.com/Q316005/Import.Server.Component.aspx ... problem though...
5
by: Vik Rubenfeld | last post by:
Is there a way to import an MS Access database .mdb file into MySQL running locally on a Mac? Thanks in advance to all for any info.
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
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...
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...
0
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.