DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Accessing a file using a UNC name

  1. #1
    Steven Reid Guest

    Accessing a file using a UNC name

    HI,

    I need to be able to open a file from a network drive without mapping it to
    a drive.

    e.g. \\server1\imports\01Mar2000.csv

    Is there anything special I need to do in VB 6 to do this?

    Thanks in advance

    Steve



  2. #2
    Phil Weber Guest

    Re: Accessing a file using a UNC name

    > Is there anything special I need to do in VB6
    > to do this?


    Steve: Nope! The following works fine:

    Dim hFile As Integer
    Dim sText As String

    hFile = FreeFile
    Open "\\server1\imports\01Mar2000.csv" For Input As hFile
    Do Until EOF(hFile)
    Line Input #hFile, sText
    Debug.Print sText
    Loop
    Close hFile

    ---
    Phil Weber



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center