Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

data import

Status
Not open for further replies.

petermeachem

Programmer
Aug 26, 2000
2,270
GB
Does anyone know of a good control to help with data import. I need something like the Access text import wizard. I good control would be well worth buying, there's a lot of work involved otherwise.
 
Hi
To which format you to import? Walid Magd
Engwam@Hotmail.com
 
Hi my friend
I never used Access in my life but I know that it has a COM interface. So you can do something like this
Dim x As Access.Application
Also when I tried to play with this object I found this command
Code:
 x.RunCommand (acCmdImport)
.
But this is the best I could do, try to continue play with that to see what parameters needs to be set for the source and target file. Good luck to you Walid Magd
Engwam@Hotmail.com
 
petermeachem,
Try binding the textfile to your database by writing a custom schema.ini file. Then, once it is bound, simply write some SQl to do an Insert into the target table with a select from the source table. Any required field mapping could be done here as well. This is the fastest way I've seen to import data into access fro outside of access and it can be totally automated.
- Jeff Marler B-)
 
Peter,

Jeff is on the 'right track', but your question seems (to me) to imply a broader need. I have used the Import 'wizzard' to set up quite a few different (named) import specifications, and re-used them in code to do a variety of FIXED imports (e.g. FIXED ==> same data layout). This can be a reasonable approach to a repetive / production approach. Beyond that, I would need to know what additional capability is necessary.


MichaelRed
redmsp@erols.com

There is never time to do it right but there is always time to do it over
 
I have to agree with MichaelRed . . . the technique I posted will allow you to do basic imports from text files into Access DB tables, but beyond that, what are you really looking for? - Jeff Marler B-)
 
No, this is for a VB programme that we are hopefully going to sell quite a few of. I need a non-Access solution that is as chummy as possible. The users will have to identify fields in their data that match what the programme needs, e.g. column 4 in a text source is the surname. It must be REALLY easy to use (members of the public are involved!) so I thought someone might have produced an ocx to do this sort of thing. The import will have to macth the (unknown) users file spec, so I can't supply a preformatted one. I think I'll have to roll my own though.

What are you lot doing working on Easter Monday anyway. Or perhaps it's not a holiday where you are.
 
Easter Monday is a holiday? Wow . . . no one told me! Can I go home!? Out here (USA) it's tax day . . . do you know where your taxes are?

OK . . . back to business . . .
Peter,
It would not be that hard to develop an OCX that would create the Schema.ini file for you . . . in fact I kind of like the idea and am going to write one myself now. I already have an app that I developed that does this and itr should not be too hard to convert it into an OCX . . . interested? - Jeff Marler B-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top