Results 1 to 8 of 8

Thread: Usb flash drive letter problem

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2013
    Posts
    3

    Usb flash drive letter problem

    Hello,
    I am working with a local history group on transcribing data from photographs of one hundred year old documents. Character recognition programs can't cope with the quality of the documents. We would like to give people a selection of photographs for them to transcribe on to a usb stick. I have created a small database with Visual Data Manager within Visual Basic 6. Unfortunately the database has a fixed file path which defaults to the usb stick it was created on. Some of the people we hope to enrol as transcribers have machines running XP other have Windows 7. When a usb stick is plugged into a different machine from the one that created it, it assumes the next free drive letter which may not be the same as the original which means that the database will not then work. Some of these people are elderly and I cannot expect them to start tinkering with control panel to change the drive letter. The transcribers are not always local so it is not possible to visit them to alter their machines. Does anyone know of a simple way of forcing a usb drive to change the drive letter to a specific letter and will work on both XP and Win7 machines AND which will reside on the usb stick itself. I don't want the stick to have any effect on the machine that it is plugged into. Any suggestions or alternatives would be welcome. (My level of skill with VB would make a novice look expert!)
    Last edited by pergolaman; Feb 19th, 2013 at 05:47 PM.

  2. #2
    Frenzied Member
    Join Date
    Mar 2008
    Posts
    1,210

    Re: Usb flash drive letter problem

    If the current drive (eg. like that set using ChDrive) when the code runs is equal (or made equal) to the stick's drive letter 'the fixed file path which etc.' will not need to include a drive letter. So it could be specified as relative path like \MyPath rather than a specific one like F:\MyPath.
    If the current drive is not equal to the stick's drive letter when the code runs then you could search through your drives and their types until you find a 'removable disk' which is not a CD, it will most likely be the stick you want but you could check if it is the exactly the right stick by checking its Volume name (which has been setup beforehand).

  3. #3
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: Usb flash drive letter problem

    Or if the exe is on the USB simply use app.path

  4. #4

    Thread Starter
    New Member
    Join Date
    Feb 2013
    Posts
    3

    Re: Usb flash drive letter problem

    Thank you both for your responses.

    Magic Ink - Visual Data Manager doesn't allow \mypath but adds the drive letter automatically - when you try to edit the drive path in properties is declares it to be read only...

    Datamiser - .exe and database file are both on stick but as I am very new to any of this I have no idea how to use app.path and is isn't in the books that I have either.

  5. #5
    Frenzied Member
    Join Date
    Mar 2008
    Posts
    1,210

    Re: Usb flash drive letter problem

    >Visual Data Manager doesn't allow ...

    Given http://msdn.microsoft.com/en-us/libr...(v=vs.60).aspx indicates that;
    'VisData is an application that was created using Visual Basic. A built version of VisData is used as an add-in accessible from the Add-Ins menu. In the Professional and Enterprise editions the source code for VisData is available in the samples directory.'

    I guess you could hack the VisData source code to make it allowed if the app is running on a stick i.e. on a removable drive which is not a CD; you can determine that via the Windows DriveType api Function.

  6. #6

    Thread Starter
    New Member
    Join Date
    Feb 2013
    Posts
    3

    Re: Usb flash drive letter problem

    Magic Ink - If I knew how - like I said I am very new to this. The original idea was simple - give someone a stick with the programme on and let them enter data irrespective of the software on their own machine. We would get the stick back and retrieve the data. What would have been something very simple seems to be far more complicated in practice!

  7. #7
    Lively Member
    Join Date
    Apr 2011
    Posts
    75

    Re: Usb flash drive letter problem

    Please consider how easy that would be to spread all manner of viruses and other infections

  8. #8
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: Usb flash drive letter problem

    Ah the old visdata, I forgot about that program, used to use it back in the 90s but did not even know it was shipped with VB6, I had it with VB5

    Anyway the source is included with VB6 so it would be a simple matter to make a few changes to it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width