MkDir Method

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sue

    MkDir Method

    AccessXP in Access2000 Mode:

    In my code I use the MkDir method to create a folder and then I want to use the
    transfertext method to create a delimited text file in that folder. MkDir runs
    and then when transfertext runs I get a message that a file can not be created
    in the folder because the folder is Read Only. When I check the folder's
    attributes with Windows Explorer, sure enough the folder is Read Only.

    How can I use the MkDir method and not get a Read Only folder?

    Thanks for all help!

    Sue




  • Peter Doering

    #2
    Re: MkDir Method

    > AccessXP in Access2000 Mode:
    [color=blue]
    > In my code I use the MkDir method to create a folder and then I want to use the
    > transfertext method to create a delimited text file in that folder. MkDir runs
    > and then when transfertext runs I get a message that a file can not be created
    > in the folder because the folder is Read Only. When I check the folder's
    > attributes with Windows Explorer, sure enough the folder is Read Only.[/color]
    [color=blue]
    > How can I use the MkDir method and not get a Read Only folder?[/color]

    I think this is not the problem. Do you have a ChDir to the new folder
    before TransferText?

    Peter

    --
    No mails please.

    Comment

    • Peter Doering

      #3
      Re: MkDir Method

      Sue,
      [color=blue]
      > Should I have a ChDir before TransferText or not and WHY???[/color]

      You should have one or at least should be sure to have the output path
      right. This is just guessing as long as I don't know the commands. Can you
      post the procedure please?

      What OS are you on? W2k, WXP or something else?

      Peter

      --
      No mails please.

      Comment

      • Peter Doering

        #4
        Re: MkDir Method

        Sue,
        [color=blue]
        > Dim StrFolder As String
        > Dim StrFile As String
        > StrFolder = "C:\Comic Box\WebStore Interface Database\UpLoad ChangeFiles\"
        > StrFile = "NewStoreIt em" & Format(Now(), "yymmddhhnn ") & ".txt"
        > DoCmd.TransferT ext acExportDelim, "NewStoreIt em Export Specification", _
        > "QryPFrmAddNewI temToWebStore", StrFolder & StrFile, False[/color]

        Where's the MkDir?

        Peter

        --
        No mails please.

        Comment

        • Sue

          #5
          Re: MkDir Method


          "Peter Doering" <news@doering.o rg> wrote in message
          news:bknch4$3jt s8$1@ID-204768.news.uni-berlin.de...[color=blue]
          > Sue,
          >[color=green]
          > > Dim StrFolder As String
          > > Dim StrFile As String
          > > StrFolder = "C:\Comic Box\WebStore Interface Database\UpLoad ChangeFiles\"
          > > StrFile = "NewStoreIt em" & Format(Now(), "yymmddhhnn ") & ".txt"
          > > DoCmd.TransferT ext acExportDelim, "NewStoreIt em Export Specification", _
          > > "QryPFrmAddNewI temToWebStore", StrFolder & StrFile, False[/color]
          >
          > Where's the MkDir?
          >
          > Peter
          >
          > --
          > No mails please.[/color]


          Comment

          • Sue

            #6
            Re: MkDir Method

            Sorry! I stripped out some code that did not apply to my question and
            inadvertently deleted the MkDir code.

            Something else I noticed ---------
            I'm using WindowsXP. If I use Windows Explorer and create a new folder and then
            check the properties of the new folder, the new folder is Read Only. Seems odd!!
            So I went to my laptop (Windows ME) and created a new folder and the Read Only
            attribute is not checked. ?????

            Dim StrFolder As String
            Dim StrFile As String
            StrFolder = "C:\Comic Box\WebStore Interface Database\UpLoad ChangeFiles\"
            If Len(Dir$(StrFol der, vbDirectory)) = 0 Then
            MkDir (StrFolder)
            MsgBox "The Folder 'UpLoadChangeFi les' Has Been Created In" & vbCrLf _
            & "C:\Comic Box\WebStore Interface Database\", , "Folder
            'UpLoadChangeFi les'"
            End If
            StrFile = "NewStoreIt em" & Format(Now(), "yymmddhhnn ") & ".txt"
            DoCmd.TransferT ext acExportDelim, "NewStoreIt em Export Specification", _
            "QryPFrmAddNewI temToWebStore", StrFolder & StrFile, False

            Thanks, Peter!!

            Sue


            "Peter Doering" <news@doering.o rg> wrote in message
            news:bknch4$3jt s8$1@ID-204768.news.uni-berlin.de...[color=blue]
            > Sue,
            >[color=green]
            > > Dim StrFolder As String
            > > Dim StrFile As String
            > > StrFolder = "C:\Comic Box\WebStore Interface Database\UpLoad ChangeFiles\"[/color][/color]
            If Len(Dir$(StrFol der, vbDirectory)) = 0 Then
            MkDir (StrFolder)
            MsgBox "The Folder 'UpLoadChangeFi les' Has Been Created In" & vbCrLf _
            & "C:\Comic Box\WebStore Interface Database\", , "Folder
            'UpLoadChangeFi les'"
            End If[color=blue][color=green]
            > > StrFile = "NewStoreIt em" & Format(Now(), "yymmddhhnn ") & ".txt"
            > > DoCmd.TransferT ext acExportDelim, "NewStoreIt em Export Specification", _
            > > "QryPFrmAddNewI temToWebStore", StrFolder & StrFile, False[/color]
            >
            > Where's the MkDir?
            >
            > Peter
            >
            > --
            > No mails please.[/color]


            Comment

            • Peter Doering

              #7
              Re: MkDir Method

              Sue,
              [color=blue]
              > <<Can you right-click on the folder and change its attributes? If not, you have
              > insufficient rights for your HD.>>[/color]
              [color=blue]
              > I can uncheck Read Only but when I close Properties and then reopen Properties,
              > Read Only is checked again. How do I get sufficient rights to my HD?[/color]

              Rights are off-topic here, you may want seek for help at e.g.
              microsoft.publi c.windowsxp.gen eral.

              Before you do that, test following:

              - Login as administrator and open windows explorer.
              - Create folder "C:\Comic Box\WebStore Interface Database\UpLoad ChangeFiles\".
              - In this folder create "NewStoreItem03 09220000.txt".
              - Delete both again.

              If it works, try your Access procedure again.

              Peter

              --
              No mails please.

              Comment

              • Michael \(michka\) Kaplan [MS]

                #8
                Re: MkDir Method

                ACTUALLY,

                The error has nothing to do with the directory being read only. It is an
                incorrect extension issue -- try .TXT.


                --
                MichKa [MS]

                This posting is provided "AS IS" with
                no warranties, and confers no rights.


                "Peter Doering" <news@doering.o rg> wrote in message
                news:bknklj$3j1 da$1@ID-204768.news.uni-berlin.de...[color=blue]
                > Sue,
                >[color=green]
                > > <<Can you right-click on the folder and change its attributes? If not,[/color][/color]
                you have[color=blue][color=green]
                > > insufficient rights for your HD.>>[/color]
                >[color=green]
                > > I can uncheck Read Only but when I close Properties and then reopen[/color][/color]
                Properties,[color=blue][color=green]
                > > Read Only is checked again. How do I get sufficient rights to my HD?[/color]
                >
                > Rights are off-topic here, you may want seek for help at e.g.
                > microsoft.publi c.windowsxp.gen eral.
                >
                > Before you do that, test following:
                >
                > - Login as administrator and open windows explorer.
                > - Create folder "C:\Comic Box\WebStore Interface[/color]
                Database\UpLoad ChangeFiles\".[color=blue]
                > - In this folder create "NewStoreItem03 09220000.txt".
                > - Delete both again.
                >
                > If it works, try your Access procedure again.
                >
                > Peter
                >
                > --
                > No mails please.[/color]


                Comment

                • Peter Doering

                  #9
                  Re: MkDir Method

                  > ACTUALLY,
                  [color=blue]
                  > The error has nothing to do with the directory being read only. It is an
                  > incorrect extension issue -- try .TXT.[/color]

                  ??

                  What's the difference between .txt and .TXT on WXP?

                  Peter

                  --
                  No mails please.

                  Comment

                  Working...