Thursday, April 19, 2012

SQL query doesn't return full results for only one field

I'm having a problem using VBA to execute a SQL query and copy the results into an Excel worksheet.

When the sub excecutes, it only copies rows that are multiples of 256 (so rows 256, 512, 768 etc are the only ones that are filled into Excel). I'm having no problem copying any of the other fields from the database. Also, when I run the same query in MySQL it works fine. Being fairly new to both SQL and VBA I can't see any reason why this particular field should be causing trouble. The only thing I can think of is that its contents are a string that always begins with an underscore (and I only mention that because it's the only difference between it and some of the other fields).

Does anybody have any ideas as to why this may be happening?



No comments:

Post a Comment