Solved

Import text (ASCII) file into access 97 from VB5

Posted on 1998-06-30
3
214 Views
Last Modified: 2012-06-27
How can I import a Text (ASCII) file into my Access 97 table
using VB 5.0.
0
Comment
Question by:rhnguyen
3 Comments
 
LVL 4

Expert Comment

by:tomook
ID: 1464625
The short answer: write an import routine. To help you further we will need the format of the text file and the format of the table(s) you wish to populate.
0
 
LVL 18

Expert Comment

by:deighton
ID: 1464626
You can read data in from your text file using

'open your data base here

Open "yourfile.txt" for input as #1
   line input #1,sLine

do until eof(1)
   ..
'''   chop your string up here using mid,left right etc

   rs.addnew

 '''  adn populate your database fields

     rs.update  

   line input #1,sLine

loop

close #1
0
 
LVL 9

Accepted Solution

by:
cymbolic earned 50 total points
ID: 1464627
Here's the easiest method.  Import the text file manually once, and save the import spec.  Then, you can either make a vba module invoked by a macro, or import using a macro command in MS Access.  You can them invoke the macro, which causes an automatic import via a command line parameter to MS Access.  If you need to cause this in VB, then you can use the Shell command to invoke Access and run the macro, or there are other API methods in addition to invoke Access and cause it to do the import for you.

In ms access, look up help for the docmd, and transfertext commands to get specifics and options.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now