Click here to Skip to main content
15,918,267 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Help with Integrating MS Word in VB.NET Pin
Jats_4ru18-Apr-08 3:14
Jats_4ru18-Apr-08 3:14 
QuestionHashing password, HOW ? Pin
masoodp66617-Apr-08 22:49
masoodp66617-Apr-08 22:49 
AnswerRe: Hashing password, HOW ? Pin
Guffa18-Apr-08 0:42
Guffa18-Apr-08 0:42 
GeneralRe: Hashing password, HOW ? [modified] Pin
Rob Smiley18-Apr-08 5:51
Rob Smiley18-Apr-08 5:51 
GeneralRe: Hashing password, HOW ? Pin
masoodp66618-Apr-08 8:02
masoodp66618-Apr-08 8:02 
GeneralRe: Hashing password, HOW ? Pin
Guffa18-Apr-08 12:06
Guffa18-Apr-08 12:06 
GeneralRe: Hashing password, HOW ? Pin
Rob Smiley18-Apr-08 23:33
Rob Smiley18-Apr-08 23:33 
QuestionString or binary data would be truncated. The statement has been terminated Pin
zaimah17-Apr-08 18:11
zaimah17-Apr-08 18:11 
GeneralRe: String or binary data would be truncated. The statement has been terminated Pin
Christian Graus17-Apr-08 19:46
protectorChristian Graus17-Apr-08 19:46 
GeneralRe: String or binary data would be truncated. The statement has been terminated Pin
darkelv17-Apr-08 19:48
darkelv17-Apr-08 19:48 
GeneralRe: String or binary data would be truncated. The statement has been terminated Pin
zaimah17-Apr-08 20:59
zaimah17-Apr-08 20:59 
GeneralRe: String or binary data would be truncated. The statement has been terminated Pin
Ashfield17-Apr-08 21:15
Ashfield17-Apr-08 21:15 
GeneralRe: String or binary data would be truncated. The statement has been terminated Pin
Christian Graus17-Apr-08 21:47
protectorChristian Graus17-Apr-08 21:47 
GeneralRe: String or binary data would be truncated. The statement has been terminated Pin
zaimah17-Apr-08 23:28
zaimah17-Apr-08 23:28 
GeneralVS 2005 VB.NET: Global Module failing to initializ Pin
kindman_nb17-Apr-08 8:04
kindman_nb17-Apr-08 8:04 
GeneralRe: VS 2005 VB.NET: Global Module failing to initializ Pin
Dave Kreskowiak17-Apr-08 8:18
mveDave Kreskowiak17-Apr-08 8:18 
GeneralRe: VS 2005 VB.NET: Global Module failing to initializ Pin
kindman_nb17-Apr-08 13:48
kindman_nb17-Apr-08 13:48 
GeneralRe: VS 2005 VB.NET: Global Module failing to initializ Pin
Dave Kreskowiak18-Apr-08 3:57
mveDave Kreskowiak18-Apr-08 3:57 
GeneralCompare values in DataRow field with its original value Pin
Steven J Jowett17-Apr-08 6:28
Steven J Jowett17-Apr-08 6:28 
GeneralRe: Compare values in DataRow field with its original value Pin
Dave Kreskowiak17-Apr-08 8:15
mveDave Kreskowiak17-Apr-08 8:15 
GeneralRe: Compare values in DataRow field with its original value Pin
Steven J Jowett17-Apr-08 11:19
Steven J Jowett17-Apr-08 11:19 
GeneralRe: Compare values in DataRow field with its original value Pin
Dave Kreskowiak18-Apr-08 1:32
mveDave Kreskowiak18-Apr-08 1:32 
GeneralOT: DeleteFile and MoveFile in VBS Pin
stephan_00717-Apr-08 5:22
stephan_00717-Apr-08 5:22 
GeneralRe: OT: DeleteFile and MoveFile in VBS Pin
Dave Kreskowiak17-Apr-08 6:51
mveDave Kreskowiak17-Apr-08 6:51 
Simpler idea. First, check if the source file exists. Then, if it does, just copy the file from the source to the destination, overwriting the destination if the same filename exists. That way, you don't have to care if the destination exists, just to delete the thing anyway.

Now, on to your actual problem. Since MoveFile and DeleteFile do NOT return any kind of value, I think your actually checking the FSO object instance being Nothing, which will return False, and hence, log an error message.

To prevent weird problems like this, I usually don't call methods on objects inside conditional expressions. I usually assign return values to vairables and use those variables in the expressions instead. This allows for additional checking of return values, such as valid objects and values within expected ranges.


A guide to posting questions on CodeProject[^]



Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007, 2008




GeneralRe: OT: DeleteFile and MoveFile in VBS Pin
stephan_00717-Apr-08 8:24
stephan_00717-Apr-08 8:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.