Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2003
    Posts
    9

    Unanswered: "File is in use" problem.

    Hi there,
    Pls help me to sovle this problem. I have a code like that:

    dim foxcon as new ADODB.Connection
    foxcon.open "Driver={Microsoft Visual FoxPro Driver};" & _
    '"SourceType=DBF;" & _
    '"SourceDB=" & App.Path & "\Data" & ";" & _
    '"Exclusive=No"
    foxcon.Execute "select * from bangke_02" '(1)
    foxcon.Close

    foxcon.open "Driver={Microsoft Visual FoxPro Driver};" & _
    '"SourceType=DBF;" & _
    '"SourceDB=" & App.Path & "\Data" & ";" & _
    '"Exclusive=No"
    foxcon.Execute "set exclusive on;Pack bangke_02" '(2)
    foxcon.Close

    The problem is that when I add line (1) in to my code I get an error "The file is in use" when executing the line (2), if I remove line (1), line (2) work perfectly.

    Thanks for all your helps.

  2. #2
    Join Date
    Oct 2003
    Location
    Edwardsville, IL
    Posts
    8

    Re: "File is in use" problem.

    Looks like the problem is that you haven't given the cursor (1) a name to store the data in. Hence, all the driver has done is create a "filter" on the original table. Try "select * from bangke_02 into bangkecursor"

    Just a thought ...

    Originally posted by carnation
    Hi there,
    Pls help me to sovle this problem. I have a code like that:

    dim foxcon as new ADODB.Connection
    foxcon.open "Driver={Microsoft Visual FoxPro Driver};" & _
    '"SourceType=DBF;" & _
    '"SourceDB=" & App.Path & "\Data" & ";" & _
    '"Exclusive=No"
    foxcon.Execute "select * from bangke_02" '(1)
    foxcon.Close

    foxcon.open "Driver={Microsoft Visual FoxPro Driver};" & _
    '"SourceType=DBF;" & _
    '"SourceDB=" & App.Path & "\Data" & ";" & _
    '"Exclusive=No"
    foxcon.Execute "set exclusive on;Pack bangke_02" '(2)
    foxcon.Close

    The problem is that when I add line (1) in to my code I get an error "The file is in use" when executing the line (2), if I remove line (1), line (2) work perfectly.

    Thanks for all your helps.

Posting Permissions

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