| | |
VB 6 Error 75 Path File Access
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Jun 2004
Posts: 2
Reputation:
Solved Threads: 0
The error occured in this program after I changed to option explicit
and got rid of all the dollar signs and percent signs and switched to 10 or 12 character variables as showed in MSB Exaples!!
Public Sub CreateDir()
Drv = App.Path
ChDir Drv
Select Case intRegg
Case 1
Message box Placed Here showed the correct Path was Chosen so why did I get this stupid error?
Flow = Drv + "\CHXPLUS1"
MkDir Flow
Case 2
Flow = Drv + "\CHXPLUS2\"
MkDir Flow
Case 3
Flow = Drv + "\CHXPLUS3\"
MkDir Flow
Case 4
Flow = Drv + "\CHXPLUS4\"
MkDir Flow
Case 5
Flow = Drv + "\CHXPLUS5\"
MkDir Flow
Case 6
Flow = Drv + "\CHXPLUS6\"
MkDir Flow
Case Else
End Select
WriteFiles 1, 1, 0
Back2_3 4
End Sub
and got rid of all the dollar signs and percent signs and switched to 10 or 12 character variables as showed in MSB Exaples!!
Public Sub CreateDir()
Drv = App.Path
ChDir Drv
Select Case intRegg
Case 1
Message box Placed Here showed the correct Path was Chosen so why did I get this stupid error?
Flow = Drv + "\CHXPLUS1"
MkDir Flow
Case 2
Flow = Drv + "\CHXPLUS2\"
MkDir Flow
Case 3
Flow = Drv + "\CHXPLUS3\"
MkDir Flow
Case 4
Flow = Drv + "\CHXPLUS4\"
MkDir Flow
Case 5
Flow = Drv + "\CHXPLUS5\"
MkDir Flow
Case 6
Flow = Drv + "\CHXPLUS6\"
MkDir Flow
Case Else
End Select
WriteFiles 1, 1, 0
Back2_3 4
End Sub
•
•
Join Date: Mar 2009
Posts: 914
Reputation:
Solved Threads: 167
0
#2 Oct 24th, 2009
Okay, let first start by reminding you of code tags...
Then let me say where are you getting this error? What line and what are the state of your variables?
Next up is how do you add, i.e. the use of addition, two string together? (Sarcastic, yes, I know). But in reality you concatinate two string together by the use of the ampersand character (&)...
String1 = String1 & String2
Another thing I noticed is in the first case you have "\path" but in the second and thereafter cases you have "\path\"
Also, I removed all of your mkdir statements since the select case is only used to build the path and put the mkdir statement after the select case to shorten your code.
Then I removed your case else as you had no code there so no need for the case else.
Now, finally, if you are using this code on vista then that is your problem as the C:\Program Files\AppName folder is protected. Please see this thread...
http://www.vbforums.com/showthread.p...02#post2807202
for changes you need to make to your program.
Good Luck
Then let me say where are you getting this error? What line and what are the state of your variables?
Next up is how do you add, i.e. the use of addition, two string together? (Sarcastic, yes, I know). But in reality you concatinate two string together by the use of the ampersand character (&)...
String1 = String1 & String2
Another thing I noticed is in the first case you have "\path" but in the second and thereafter cases you have "\path\"
Public Sub CreateDir() Drv = App.Path If Right(Drv, 1) = "\" Then Drv = Left(Drv, Len(Drv) - 1) 'chop off any trailing back slash as you have seemed to include it below in your code so as to avoid a double backslash in the path "\\" ChDir Drv Select Case intRegg Case 1 Flow = Drv & "\CHXPLUS1" Case 2 Flow = Drv & "\CHXPLUS2" Case 3 Flow = Drv & "\CHXPLUS3" Case 4 Flow = Drv & "\CHXPLUS4" Case 5 Flow = Drv & "\CHXPLUS5" Case 6 Flow = Drv & "\CHXPLUS6" End Select MkDir Flow WriteFiles 1, 1, 0 Back2_3 4 End Sub
Also, I removed all of your mkdir statements since the select case is only used to build the path and put the mkdir statement after the select case to shorten your code.
Then I removed your case else as you had no code there so no need for the case else.
Now, finally, if you are using this code on vista then that is your problem as the C:\Program Files\AppName folder is protected. Please see this thread...
http://www.vbforums.com/showthread.p...02#post2807202
for changes you need to make to your program.
Good Luck
If anyone has helped you solve your problem, please mark your thread as solved.
Thanks
Thanks
![]() |
Similar Threads
- credui.dll error & lost 'view network connections' (Windows NT / 2000 / XP)
- Path without file (Visual Basic 4 / 5 / 6)
- Reading from non existant Text file (Visual Basic 4 / 5 / 6)
- Got spy/malware, got rid of most of it, still having problems (Viruses, Spyware and other Nasties)
- Amaena, SysProtect, WinAntivirus popups (Viruses, Spyware and other Nasties)
- hijackthis (Viruses, Spyware and other Nasties)
- Visual Basic Shell Execute issue (Visual Basic 4 / 5 / 6)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: What Could be wrong here!!!
- Next Thread: Plz, Correct this Code
Views: 389 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for Visual Basic 4 / 5 / 6
* 6 429 2007 access activex add age append application basic beginner birth bmp c++ calculator cd cells.find click client code college column component connection copy creat ctrl+f data database datareport date delete dissertations dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver struct subroutine table tags textbox time timer urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





