A: 

Can you set your code up in a format such as the following, in which you delay opening the output file until after you have fired your query and retrieved at least one response:

Set up SQL statement 
Execute SQL query 
init bFirstRecord as true 
Loop over results   
  if bFirstRecord
   check folder and file existence, create as necessary
   open output file
   bFirstRecord = false   
  end if   
  write record to output 
End Loop
Close up files, etc
Ed Schembor
A: 

You could put

If rs.RecordCount > 0 Then
   exit sub
End If

before

Dim objFSO : Set objFSO = CreateObject("Scripting.FileSystemObject")
Dim objFile, objFolder

i.e. Don't execute any of the statements, if there are no records.

shahkalpesh