what would keep a ini file open on a file server?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: what would keep a ini file open on a file server?

  1. #1
    Bill A Guest

    what would keep a ini file open on a file server?


    Main question is what would keep a ini file open on a file server?
    so other computers can't read from it.

    I have a ini file on a Windows 2000 workstation file server
    contents listed below

    ----- begin of ini file

    [NextNumbers]
    JobNumber=601
    BidNumber=20329

    [Database]
    DatabasePath=K:\Atlas.mdb
    ------ end of ini file

    We have a main computer station that does all the login of all jobs.
    But some other stations go to login and they cant, because the ini file is
    still open,
    if you go to the server an list all open files it shows the ini file from
    the main computer
    still has it open.

    This is the line that gets the path to the database, below

    InfoManager.DataBasePath = GetIniString("Database", "DatabasePath",
    InfoManager.IniFilePath, "K:\Atlas.mdb")


    and this is the function, below

    Public Function GetIniString(Section As String, Key As String, IniLocation
    As String, Optional default As String) As String
    Dim ReturnValue As String * 128
    Dim i, sLet
    Dim iLen As Long
    Dim length As Long
    length = GetPrivateProfileString(Section, Key, default, ReturnValue,
    128, IniLocation)
    i = InStr(1, Trim(ReturnValue), Chr(0))
    iLen = Len(Trim(ReturnValue))
    GetIniString = CStr(Left(Trim(ReturnValue), (i - 1)))
    End Function


    get new job number from ini file


    NewNumber$ = GetIniString("NextNumbers", "JobNumber",
    InfoManager.IniFilePath)



  2. #2
    T. Bradley Dean Guest

    Re: what would keep a ini file open on a file server?

    Not sure what would keep it open, but reboot the server and it will be
    fixed.

    Not to say that it won't happen again...

    --
    Bradley Dean




    Bill A <atlastruss@gbso.net> wrote in message news:3981c584@news.devx.com...
    >
    > Main question is what would keep a ini file open on a file server?
    > so other computers can't read from it.
    >
    > I have a ini file on a Windows 2000 workstation file server
    > contents listed below
    >
    > ----- begin of ini file
    >
    > [NextNumbers]
    > JobNumber=601
    > BidNumber=20329
    >
    > [Database]
    > DatabasePath=K:\Atlas.mdb
    > ------ end of ini file
    >
    > We have a main computer station that does all the login of all jobs.
    > But some other stations go to login and they cant, because the ini file is
    > still open,
    > if you go to the server an list all open files it shows the ini file from
    > the main computer
    > still has it open.
    >
    > This is the line that gets the path to the database, below
    >
    > InfoManager.DataBasePath = GetIniString("Database", "DatabasePath",
    > InfoManager.IniFilePath, "K:\Atlas.mdb")
    >
    >
    > and this is the function, below
    >
    > Public Function GetIniString(Section As String, Key As String, IniLocation
    > As String, Optional default As String) As String
    > Dim ReturnValue As String * 128
    > Dim i, sLet
    > Dim iLen As Long
    > Dim length As Long
    > length = GetPrivateProfileString(Section, Key, default, ReturnValue,
    > 128, IniLocation)
    > i = InStr(1, Trim(ReturnValue), Chr(0))
    > iLen = Len(Trim(ReturnValue))
    > GetIniString = CStr(Left(Trim(ReturnValue), (i - 1)))
    > End Function
    >
    >
    > get new job number from ini file
    >
    >
    > NewNumber$ = GetIniString("NextNumbers", "JobNumber",
    > InfoManager.IniFilePath)
    >
    >




  3. #3
    Yves Reynhout Guest

    Re: what would keep a ini file open on a file server?

    Locking the file with some API will do the trick.

    "Bill A" <atlastruss@gbso.net> wrote in message
    news:3981c584@news.devx.com...
    >
    > Main question is what would keep a ini file open on a file server?
    > so other computers can't read from it.
    >
    > I have a ini file on a Windows 2000 workstation file server
    > contents listed below
    >
    > ----- begin of ini file
    >
    > [NextNumbers]
    > JobNumber=601
    > BidNumber=20329
    >
    > [Database]
    > DatabasePath=K:\Atlas.mdb
    > ------ end of ini file
    >
    > We have a main computer station that does all the login of all jobs.
    > But some other stations go to login and they cant, because the ini file is
    > still open,
    > if you go to the server an list all open files it shows the ini file from
    > the main computer
    > still has it open.
    >
    > This is the line that gets the path to the database, below
    >
    > InfoManager.DataBasePath = GetIniString("Database", "DatabasePath",
    > InfoManager.IniFilePath, "K:\Atlas.mdb")
    >
    >
    > and this is the function, below
    >
    > Public Function GetIniString(Section As String, Key As String, IniLocation
    > As String, Optional default As String) As String
    > Dim ReturnValue As String * 128
    > Dim i, sLet
    > Dim iLen As Long
    > Dim length As Long
    > length = GetPrivateProfileString(Section, Key, default, ReturnValue,
    > 128, IniLocation)
    > i = InStr(1, Trim(ReturnValue), Chr(0))
    > iLen = Len(Trim(ReturnValue))
    > GetIniString = CStr(Left(Trim(ReturnValue), (i - 1)))
    > End Function
    >
    >
    > get new job number from ini file
    >
    >
    > NewNumber$ = GetIniString("NextNumbers", "JobNumber",
    > InfoManager.IniFilePath)
    >
    >




  4. #4
    Bill A Guest

    Re: what would keep a ini file open on a file server?

    Everybody is missing the point.
    I am using a windows routine and it is not releasing the ini file.
    Yesterday we even applied the service pack-1 for windows 2000
    to our file server and that did not fix it.

    Thanks Bill A

    Bill A <atlastruss@gbso.net> wrote in message news:3981c584@news.devx.com...
    >
    > Main question is what would keep a ini file open on a file server?
    > so other computers can't read from it.
    >
    > I have a ini file on a Windows 2000 workstation file server
    > contents listed below
    >
    > ----- begin of ini file
    >
    > [NextNumbers]
    > JobNumber=601
    > BidNumber=20329
    >
    > [Database]
    > DatabasePath=K:\Atlas.mdb
    > ------ end of ini file
    >
    > We have a main computer station that does all the login of all jobs.
    > But some other stations go to login and they cant, because the ini file is
    > still open,
    > if you go to the server an list all open files it shows the ini file from
    > the main computer
    > still has it open.
    >
    > This is the line that gets the path to the database, below
    >
    > InfoManager.DataBasePath = GetIniString("Database", "DatabasePath",
    > InfoManager.IniFilePath, "K:\Atlas.mdb")
    >
    >
    > and this is the function, below
    >
    > Public Function GetIniString(Section As String, Key As String, IniLocation
    > As String, Optional default As String) As String
    > Dim ReturnValue As String * 128
    > Dim i, sLet
    > Dim iLen As Long
    > Dim length As Long
    > length = GetPrivateProfileString(Section, Key, default, ReturnValue,
    > 128, IniLocation)
    > i = InStr(1, Trim(ReturnValue), Chr(0))
    > iLen = Len(Trim(ReturnValue))
    > GetIniString = CStr(Left(Trim(ReturnValue), (i - 1)))
    > End Function
    >
    >
    > get new job number from ini file
    >
    >
    > NewNumber$ = GetIniString("NextNumbers", "JobNumber",
    > InfoManager.IniFilePath)
    >
    >




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