Geting the refreshed version of a file

Posted on 2004-10-29
Last Modified: 2010-05-02
Hi All.

First, sorry for my bad english.

How I can get the refreshed version of a file ?

I'm running the sqlldr command from oracle client app to insert data into my database.

I have a batch file that has the following code:

sqlldr userid=comuser/ control=\dbm\ldr\prd.ldr log=\dbm\log\prd.log

then I execute the shell visual basic command:

shell "batchfile.bat > output.txt"

the sqlldr updates the file when ir runs.

With sqlldr running I goto the windows explorer, I open the file and I can see the output.txt contents.

But if in my code i make this:

Open "output.txt" for input access read as #1
line input #1, strString

strstring will be "".

Cand someone help me ?

Thx in advance.
Question by:fatalk1ll3r
    LVL 14

    Expert Comment

    Try this instead :

    Dim strstring As String
        strstring = FileLen("output.txt")
    Open "output.txt" For Binary Access Read As #1
        Get #1, 1, strstring
    Close #1

    note : strstring will contain the entire file !
    LVL 14

    Accepted Solution

    Oops, forgot to define SPACE.

    Dim strstring As String
        strstring = Space(FileLen("output.txt"))
    Open "output.txt" For Binary Access Read As #1
        Get #1, 1, strstring
    Close #1

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Article by: Martin
    Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
    Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    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…

    913 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

    17 Experts available now in Live!

    Get 1:1 Help Now