I need to execute the SQL.Request with SQL strings larger than 512

X

Xavier

The SQL.Request external function in Excel 2003 has an SQL string too short.
I need to execute the SQL.Request with SQL strings larger than 512 or more.

Is there a way to do it?
How can I do it?
 
J

Jake Marx

Hi Xavier,
The SQL.Request external function in Excel 2003 has an SQL string too
short. I need to execute the SQL.Request with SQL strings larger than
512 or more.

Is there a way to do it?
How can I do it?

You could change your methodology to use a QueryTable instead of worksheet
functions. To do this, select Data | Import External Data --> New Database
Query, then follow the prompts. It's pretty easy and powerful. If you need
more than that will do, you may have to look into programmatically
retrieving your data using VBA code.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]
 
T

Tom Ogilvy

Have you tried making the argument for the sql string be a reference to
multiple cells (continuous block) and broken up your sql string so that each
part is less than 155 characters.

I haven't tested this, but it seems to me it does work.
 
X

Xavier

Thanks Tom for your answer, but I have another problem right now, becasue I
tray to ejecute the commnad with a simple select statement and I received a
syntax error message. As a mather of fact, I am not sure if the syntax that I
am Using is ok.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top