I have manually moved the file
I am trying to move a text file( Customer.dat) to a new location and cannot get get the LOF(miFilenumber) to stop displaying 0
Public Sub LoadMyFile
Open cusfile For Random As #miFilenumber Len = Len(gCustomer)
Debug.Print Len(cusfile) ' displays 94
Debug.Print Len(gCustomer) ' displays 547
Debug.Print LOF(miFilenumber) ' displays 0 should display 48230
path to old file location C:\Program Files (x86)\Microsoft Visual Studio\VB15\addressbook\AppFolder\Customer.dat
path to new file location: C:\Users\Public\Documents\Personal\Contacts\Customer.dat
what am i doing wrong ?
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders
You are opening cusfile so cusfile must have a valid path and filename contained in it. If it does not you will not get an error because opening For Random creates a new file of the invalid filename which will have a LOF of 0
So, make sure cusfile contains a valid path and filename which I think should be:
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
You are opening cusfile so cusfile must have a valid path and filename contained in it. If it does not you will not get an error because opening For Random creates a new file of the invalid filename which will have a LOF of 0
So, make sure cusfile contains a valid path and filename which I think should be:
thanks for your reply
The path/Filename you listed is the old path that works fine
i have moved the file here
C:\Users\Public\Documents\Personal\Contacts\Customer.dat
I have double checked the path/name to no avail
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders
I only helped you with the LOF problem. As far as moving the file I have no idea as I do not see how you are trying to move it
Don't understand--->I have double checked the path/name to no avail
Why are you opening a file if all you want is to move it
Also you say Debug.Print Len(cusfile) ' displays 94
but that length is not the length of either of your two paths and it should be the length of the path\filename of the file you are opening
Last edited by jmsrickland; May 22nd, 2016 at 03:56 PM.
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
You are opening cusfile so cusfile must have a valid path and filename contained in it. If it does not you will not get an error because opening For Random creates a new file of the invalid filename which will have a LOF of 0
So, make sure cusfile contains a valid path and filename which I think should be:
So the file was already 0 to begin with. OK, that takes care of your Open file problem now what about your move problem? Copy/Paste is not the way to go; you need to do a physical move using code.
I've included two zip files. Try one or the other or both as I don't know which one actually works but one of them does
Last edited by jmsrickland; May 23rd, 2016 at 12:09 AM.
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
So the file was already 0 to begin with. OK, that takes care of your Open file problem now what about your move problem? Copy/Paste is not the way to go; you need to do a physical move using code.
I've included two zip files. Try one or the other or both as I don't know which one actually works but one of them does
thanks
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders