Results 1 to 2 of 2

Thread: file location

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2002
    Location
    Tampa Fl.
    Posts
    1

    file location

    Question regarding Visual Basic 6.0
    I want to open various files in a specific directory.
    The only way I have been able to open various files is to use the default directory
    (directory where the VB program resides)

    the following code works:
    Dim players, score
    Players = Inputbox(“Enter name of player”)
    Open players for Append as #1
    Write #1, score
    Close #1

    How can I create files in a directory other than the default directory ?
    I’ve tried ChDir “C:\Database”), path = “c:\database” but neither worked.

    Any help would be greatly appreciated

    Brooks Catlin
    [email protected]

  2. #2
    Frenzied Member KayJay's Avatar
    Join Date
    Jul 2001
    Location
    Chennai
    Posts
    1,849
    try
    VB Code:
    1. Dim players, score
    2. Players = Inputbox(“Enter name of player”)
    3. Open  [b]"C:\Database\" & [/b] players for Append as #1
    4. Write #1, score
    5. Close #1

    "Brothers, you asked for it."
    ...Francisco Domingo Carlos Andres Sebastian D'Anconia

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width