Build SQL statement longer than 1024

I

iccsi

I build my SQL statement using VBA code and it is longer than 1024
characters. It seems that it reaches limitations of MS Access one
query cell limitations.

Does SQL consider built SQL statement using VBA as a cell?


Are there any work around for this?

Your help is great appreciated,
 
D

Douglas J. Steele

There's no 1024 character limitation that I'm aware of. Let's see what your
code looks like.
 
J

John W. Vinson

I build my SQL statement using VBA code and it is longer than 1024
characters. It seems that it reaches limitations of MS Access one
query cell limitations.

Does SQL consider built SQL statement using VBA as a cell?


Are there any work around for this?

Your help is great appreciated,

A query can be far bigger than 1024 characters - 65KBytes if I recall
correctly.

Please post your code. The SQL should indeed not be "in a cell".
 
I

inungh

A query can be far bigger than 1024 characters - 65KBytes if I recall
correctly.

Please post your code. The SQL should indeed not be "in a cell".



Dim AqdfCurr As DAO.QueryDef
Dim strStub As String

strStub = " SELECT * FROM Mytable......."
' it has a query more than 1024 characters

Set AqdfCurr = CurrentDb().QueryDefs("MyQuery")
AqdfCurr.SQL = strStub

I use Debug.Print strStub and paste to the query design that it
separate in 2 parts and got error. it works when I delete the space
between them.
The immediate windows shows the SQL statement reaches the miximum of
the windows.

In the stament, there is no space beteen them.


Thansk again,
 
I

inungh

 Dim AqdfCurr As DAO.QueryDef
 Dim strStub As String

strStub = " SELECT * FROM Mytable......."
' it has a query more than 1024 characters

Set AqdfCurr = CurrentDb().QueryDefs("MyQuery")
AqdfCurr.SQL = strStub

I use Debug.Print strStub and paste to the query design that it
separate in 2 parts and got error. it works when I delete the space
between them.
The immediate windows shows the SQL statement reaches the miximum of
the windows.

In the stament, there is no space beteen them.

Thansk again,- Hide quoted text -

- Show quoted text -

Thanks millions for helping,
The problem is in my SQL statement.
Thanks again,
 

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