View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Jamie Collins Jamie Collins is offline
external usenet poster
 
Posts: 593
Default ODBC Syntax Problem

"Haldun Alay" <haldunalayATyahooDOTcom wrote ...

I think you don't need to use chr(13) and chr(10) in your sql query.


Why? A carriage return is for the benefit of the human eye, not the
sql parser. Furthermore, there is a risk the parser will strip such
characters without replacing it with a space and could resulting in
incorrect syntax e.g.

"SELECT MyCol" & Chr$(13) & Chr$(10) & "FROM MyTable;"

is parsed as

SELECT MyColFROM MyTable;

Best to use a space character rather than a carriage return.

Jamie.

--