Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 6th, 2005, 07:08 AM
Registered User
 
Join Date: Oct 2005
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Text File-Newbie VBA Access

Hello All,

  How does Access VBA read text files? What characters determines the end of record? end of file?
Is there a limit to the size of text files?

Thanks for any help.
Matt
Reply With Quote
  #2 (permalink)  
Old October 6th, 2005, 07:18 AM
Registered User
 
Join Date: Oct 2005
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here is my text processing code (this is the basic functions I'm using)

    Select Case Me.OpenMode
        Case tfOpenReadOnly
            If Me.AutoCreate Then
                Open Me.Path For Binary Access Read As mhFile
            Else
                Open Me.Path For Input Access Read As mhFile
            End If
        Case tfOpenReadWrite
            Open Me.Path For Binary Access Read Write As mhFile
        Case tfOpenAppend
            Open Me.Path For Append Access Read Write As mhFile
        Case Else
            ' Bad value of OpenMode, throw an error
            Err.Raise conErrInvalidProcCall
    End Select


    If Me.IsOpen Then
        hFile = Me.Handle
        If Not VBA.EOF(hFile) Then
            Line Input #hFile, mstrCurrentLine
            ReadNext = True
        End If
    End If

    Line Input #hFile, mstrCurrentLine
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Link a text file to Access using VBA wscheiman Access VBA 1 June 30th, 2013 07:02 PM
vba file access rema Excel VBA 0 August 28th, 2008 05:03 AM
Access VBA - Controlling Text boxes in a form Scripts82 Access VBA 4 February 8th, 2006 08:35 PM
VBA access List data to text file Data-Base Access VBA 6 September 15th, 2005 04:04 PM
import data from text file to excel(VBA) topr Excel VBA 2 August 26th, 2004 11:36 PM



All times are GMT -4. The time now is 03:37 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.