how to remove the error couldn,t find file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • veer
    New Member
    • Jul 2007
    • 198

    how to remove the error couldn,t find file

    the error on line
    set dbmaster = workspaces(0).O pendatabase(sDi rFolder)
    [code=vb]
    Dim dbmaster As DAO.Database
    Dim dbparent As DAO.Database
    Dim sDirFolder As String
    Dim sArrayFolder() As String
    Dim squery As String
    Dim icount As Integer
    Dim sTable As String

    Set dbparent = Workspaces(0).O penDatabase(txt parentMDBFile)

    sDirFolder = Dir(txtchildMDB File.Text & "\", vbDirectory)
    Do While sDirFolder <> ""
    If sDirFolder <> "." And sDirFolder <> ".." Then
    ReDim Preserve sArrayFolder(ic ount) As String
    sArrayFolder(ic ount) = sDirFolder
    icount = icount + 1
    lblmerge.Captio n = "Directorie s Found="
    lblcount = icount
    End If
    sDirFolder = Dir()
    Loop

    For icount = 0 To UBound(sArrayFo lder())
    sDirFolder = Dir(txtchildMDB File.Text & "\" & sArrayFolder(ic ount) & "\*.mdb", vbDirectory)

    Do While sDirFolder <> ""
    If sDirFolder <> "." And sDirFolder <> ".." Then
    Set dbmaster = Workspaces(0).O penDatabase(sDi rFolder)
    sTable = Right(sDirFolde r, InStrRev(sDirFo lder, "\*.mdb"))
    sTable = Replace(sTable, ".mdb", "")
    sTable = "E" & sTable
    squery = " insert into " & txtparenttable & " IN '" & txtparentMDBFil e & " ' select * from " & sTable
    dbparent.Execut e (squery)
    End If
    sDirFolder = Dir()
    Loop
    Next
    [/code]
    Last edited by debasisdas; Nov 14 '07, 08:44 AM. Reason: Formatted using code=vb tags.
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Please check for existance of the file in the path.

    Comment

    • veer
      New Member
      • Jul 2007
      • 198

      #3
      File is exsit
      when it comes in sdirfolder database, it is not opening
      will you please tell me wheather the DAO access the remotely access database because the folders data which i am accessing is not on my hard drive



      Originally posted by debasisdas
      Please check for existance of the file in the path.

      Comment

      • QVeen72
        Recognized Expert Top Contributor
        • Oct 2006
        • 1445

        #4
        Hi,

        Remote Access...? Are the mdb's in the LAN Network or Remote URL..?
        If in LAN, You should have Read/Write Access to the Shared Folder. and
        It should look like this :

        \\OtherCompName \SharedFoldName

        Post the contents of txtchildMDBFile ..?

        Regards
        Veena

        Comment

        • veer
          New Member
          • Jul 2007
          • 198

          #5
          the contents of txtchildmdbfile " Server:\YpData\ NewData\ multiple folder that i am accessing


          Dim dbchild As DAO.Database
          Dim dbparent As DAO.Database
          Dim sDirFolder As String
          Dim sArrayFolder() As String
          Dim squery As String
          Dim icount As Integer
          Dim sTable As String
          Set dbparent = Workspaces(0).O penDatabase(txt parentMDBFile)

          sDirFolder = Dir(txtchildMDB File.Text & "\", vbDirectory)
          Do While sDirFolder <> ""
          If sDirFolder <> "." And sDirFolder <> ".." Then
          ReDim Preserve sArrayFolder(ic ount) As String
          sArrayFolder(ic ount) = sDirFolder
          icount = icount + 1
          lblmerge.Captio n = " Directories Found = "
          lblcount = icount
          End If
          sDirFolder = Dir()
          Loop

          For icount = 0 To UBound(sArrayFo lder())
          sDirFolder = Dir(txtchildMDB File.Text & "\" & sArrayFolder(ic ount) & "\*.mdb", vbDirectory)

          Do While sDirFolder <> ""
          If sDirFolder <> "." And sDirFolder <> ".." Then
          Set dbmaster = Workspaces(0).O penDatabase(sDi rFolder)
          sTable = Right(sDirFolde r, InStrRev(sDirFo lder, "\"))
          sTable = Replace(sTable, ".mdb", "")
          sTable = "V" & sTable
          squery = " insert into " & txtparenttable & " IN '" & txtparentMDBFil e & " ' select * from " & sTable
          dbparent.Execut e (squery)
          End If
          sDirFolder = Dir()
          Loop
          Next

          thanks in advance


          Originally posted by QVeen72
          Hi,

          Remote Access...? Are the mdb's in the LAN Network or Remote URL..?
          If in LAN, You should have Read/Write Access to the Shared Folder. and
          It should look like this :

          \\OtherCompName \SharedFoldName

          Post the contents of txtchildMDBFile ..?

          Regards
          Veena

          Comment

          • QVeen72
            Recognized Expert Top Contributor
            • Oct 2006
            • 1445

            #6
            Hi,

            No need to post whole of your Code Every time..

            Can you run directly this from your system and see the Contents in this folder..?

            Server:\YpData\ NewData\

            How is the Sharing..? Read/Writ Enabled..?

            Regards
            Veena

            Comment

            • veer
              New Member
              • Jul 2007
              • 198

              #7
              yes i am running directly from my system
              but the code which i am accesing is on the 2nd system but i have both read and write permissions


              Originally posted by QVeen72
              Hi,

              No need to post whole of your Code Every time..

              Can you run directly this from your system and see the Contents in this folder..?

              Server:\YpData\ NewData\

              How is the Sharing..? Read/Writ Enabled..?

              Regards
              Veena

              Comment

              Working...