I did that in the past, but find that many a time the client uses the 
wrong pendrive, and that is the only one they have. If the app does not 
find the special file, then back up does not occur and that defeats the 
whole purpose.

I need them to be able to use ANY pendrive and the system has to detect 
that one is placed in the USB port.

I did not say, for the sake of simplicity, that my routine should be 
triggered automatically, after closing hours. So it is a bit more 
complicated than the snippet I published. But the main thing is that the 
system needs to know that there is a pendrive there, otherwise, the 
backup procedure will not start.

Thanks anyways

Rafael Copquin


El 23/05/2010 15:25, John Weller escribió:
> Could you put a small file on the pendrive and test for that?
>
> John Weller
> 01380 723235
> 07976 393631
>
>
>    
>> I need to backup the database and all tables to a pendrive. About a year
>> ago I made a form using the drivetype function to detect that the
>> pendrive had in effect been plugged to the machine.
>>
>> It worked like a charm, but then, the OS was XP Prof.
>>
>> Now the client switched to W7 Home Premium and the function does not work.
>>
>> What it does is say, "yes, there is a pendrive there", when in fact
>> there is none.
>>
>> _I am using VFP9 SP 1_.
>>
>> If you are curious, a snippet of the code I use is:
>>
>>
>> local cDrives,cLetter,lOK
>>
>> lOK = .f.
>>
>> cDrives
>> =[D:,E:,F:,G:,H:,I:,J;,K;,L:,M:,N:,O:,P:,Q:,R:,S:,T:,U:,V:,W:,X:,Y:,Z:]
>>
>> For i = 1 to GetWordCount(cDrives,[,])
>>
>>      cLetter = GetWordNum(cDrives,i,[,])
>>      If InList(DriveType(cLetter),2,4)
>>         lOK = .t.
>>         thisform.cDriveLetter = cLetter
>>         exit
>>      else
>>         lOK = .f.
>>      endif
>>
>>
>> EndFor
>>
>>
>> Return lOK
>>
>> The computer has 5 "buil-in" usb ports (G,H,I,J,K)
>>
>> When the above loop reaches the G letter (or if I modify the cDrives
>> string, the H,or I, etc. letters) it initializes the lOK variable to
>> .T., when in reality, theres is no pendrive attached.
>>
>> Why would this be? Is there any incompatibility with the DriveType
>> function and Windows 7?
>>
>>
>> TIA
>>
>> Rafael Copquin
>>
>>      
>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to