Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
MarkyBoy666
Starting Member
14 Posts |
Posted - 2005-02-10 : 11:30:56
|
| Hello,I'm new to DTS and was wondering if anyone could help me with this.I'm wanting to perform a variation on the code:For Each fsoFile In fsoFolder.Fileswhich would normally loop through all files in a folder...but what I'm wanting to do instead is to modify this to only return the FIRST file in the folder (any file, it doesn't really matter which). Sort of something like...For FIRST fsoFile In fsoFolder.FilesDoes anyone know what the syntax I'm looking for is?Many, many thanks indeed. |
|
|
Maquis
Starting Member
25 Posts |
Posted - 2005-03-03 : 11:13:48
|
| How about this? You would exit the for loop after the first time, with the filename saved in a variable name and/or global variable... For Each fsoFile in fsoFolder.Files sSourceFile = fsoFile.Name DTSGlobalVariables("filename").Value = fsoFile.Name exit for Next |
 |
|
|
|
|
|