By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,139 Members | 1,228 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,139 IT Pros & Developers. It's quick & easy.

MkDir Method

P: n/a
Sue
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


Nov 12 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
> 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?


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

Peter

--
No mails please.
Nov 12 '05 #2

P: n/a
Sue,
Should I have a ChDir before TransferText or not and WHY???


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.
Nov 12 '05 #3

P: n/a
Sue,
Dim StrFolder As String
Dim StrFile As String
StrFolder = "C:\Comic Box\WebStore Interface Database\UpLoadChangeFiles\"
StrFile = "NewStoreItem" & Format(Now(), "yymmddhhnn") & ".txt"
DoCmd.TransferText acExportDelim, "NewStoreItem Export Specification", _
"QryPFrmAddNewItemToWebStore", StrFolder & StrFile, False


Where's the MkDir?

Peter

--
No mails please.
Nov 12 '05 #4

P: n/a
Sue

"Peter Doering" <ne**@doering.org> wrote in message
news:bk************@ID-204768.news.uni-berlin.de...
Sue,
Dim StrFolder As String
Dim StrFile As String
StrFolder = "C:\Comic Box\WebStore Interface Database\UpLoadChangeFiles\"
StrFile = "NewStoreItem" & Format(Now(), "yymmddhhnn") & ".txt"
DoCmd.TransferText acExportDelim, "NewStoreItem Export Specification", _
"QryPFrmAddNewItemToWebStore", StrFolder & StrFile, False


Where's the MkDir?

Peter

--
No mails please.

Nov 12 '05 #5

P: n/a
Sue
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\UpLoadChangeFiles\"
If Len(Dir$(StrFolder, vbDirectory)) = 0 Then
MkDir (StrFolder)
MsgBox "The Folder 'UpLoadChangeFiles' Has Been Created In" & vbCrLf _
& "C:\Comic Box\WebStore Interface Database\", , "Folder
'UpLoadChangeFiles'"
End If
StrFile = "NewStoreItem" & Format(Now(), "yymmddhhnn") & ".txt"
DoCmd.TransferText acExportDelim, "NewStoreItem Export Specification", _
"QryPFrmAddNewItemToWebStore", StrFolder & StrFile, False

Thanks, Peter!!

Sue
"Peter Doering" <ne**@doering.org> wrote in message
news:bk************@ID-204768.news.uni-berlin.de...
Sue,
Dim StrFolder As String
Dim StrFile As String
StrFolder = "C:\Comic Box\WebStore Interface Database\UpLoadChangeFiles\" If Len(Dir$(StrFolder, vbDirectory)) = 0 Then
MkDir (StrFolder)
MsgBox "The Folder 'UpLoadChangeFiles' Has Been Created In" & vbCrLf _
& "C:\Comic Box\WebStore Interface Database\", , "Folder
'UpLoadChangeFiles'"
End If StrFile = "NewStoreItem" & Format(Now(), "yymmddhhnn") & ".txt"
DoCmd.TransferText acExportDelim, "NewStoreItem Export Specification", _
"QryPFrmAddNewItemToWebStore", StrFolder & StrFile, False


Where's the MkDir?

Peter

--
No mails please.

Nov 12 '05 #6

P: n/a
Sue,
<<Can you right-click on the folder and change its attributes? If not, you have
insufficient rights for your HD.>> 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?


Rights are off-topic here, you may want seek for help at e.g.
microsoft.public.windowsxp.general.

Before you do that, test following:

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

If it works, try your Access procedure again.

Peter

--
No mails please.
Nov 12 '05 #7

P: n/a
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" <ne**@doering.org> wrote in message
news:bk************@ID-204768.news.uni-berlin.de...
Sue,
<<Can you right-click on the folder and change its attributes? If not, you have insufficient rights for your HD.>>
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?


Rights are off-topic here, you may want seek for help at e.g.
microsoft.public.windowsxp.general.

Before you do that, test following:

- Login as administrator and open windows explorer.
- Create folder "C:\Comic Box\WebStore Interface

Database\UpLoadChangeFiles\". - In this folder create "NewStoreItem0309220000.txt".
- Delete both again.

If it works, try your Access procedure again.

Peter

--
No mails please.

Nov 12 '05 #8

P: n/a
> ACTUALLY,
The error has nothing to do with the directory being read only. It is an
incorrect extension issue -- try .TXT.


??

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

Peter

--
No mails please.
Nov 12 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.