• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 663
  • Last Modified:

TransferText Problem

I'm writing a VB Program that allows me to transfer data from a fixed width log file to an Access Database.

I'm getting the following error with my TransferText line:

DoCmd.TransferText acImportFixed, "ReaderSpec", "Data3", "H:\EE 464H\Sentinel020320032130.txt", True

acImportFixed - Variable not declared.


Is there a Reference I need to include in order to get this to be declared?  I'm new to VB and am stumped.

Thanks,

J
0
longhorn03
Asked:
longhorn03
1 Solution
 
Éric MoreauSenior .Net ConsultantCommented:
replace the constant by its value
0
 
longhorn03Author Commented:
where can I find that value?
0
 
Éric MoreauSenior .Net ConsultantCommented:
its value is 1
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
bob_onlineCommented:
Are you writing a VB program or a VBA program?  If you're in an Access database, it's VBA and the constant should work.  If you running VB (VB 6.0, etc) then a lot of your code isn't going to work.
0
 
longhorn03Author Commented:
I'm running VB 6.0.  Would it be easier to simply do a line-by-line insertion of data into the database?

And why do you say that a lot of the code isn't going to work?

Thanks,

J
0
 
MN_DaveCommented:
In VB you would need to add a reference to the Microsoft Access Object Library.  Then create an object and punch on the TransferText method of that object. Something like this:

Dim ACObject As Access.Application

Set ACObject = CreateObject("Access.Application")

With ACObject
    .OpenCurrentDatabase filepath:="Path to Access DB"
    .DoCmd.TransferText acImportFixed, "ReaderSpec", "Data3", "H:\EE 464H\Sentinel020320032130.txt", True

End With
0
 
Éric MoreauSenior .Net ConsultantCommented:
And all users of your application will need to have Access installed on their PCs.
0
 
longhorn03Author Commented:
Unfortunately, my preferred solution isn't working out.  However, this is the code that showed me this unfortunate fact.  Thanks for you help, everyone, I'm going to go another direction with this.

-Jonathan
0
 
raspicuiCommented:
well......you may view the priority to reference, and you can agreed the reference Microsoft Componets......

OK

 
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now