Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / April 2007

Tip: Looking for answers? Try searching our database.

Character limit to SQL select string

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JimP - 26 Apr 2007 20:34 GMT
Is there a 255 character limit to the length of a SQL SELECT statement in
VBA, e.g.

strSQL="SELECT... (max 255 chars yes or no)"?
Marshall Barton - 27 Apr 2007 00:34 GMT
>Is there a 255 character limit to the length of a SQL SELECT statement in
>VBA, e.g.
>
>strSQL="SELECT... (max 255 chars yes or no)"?

No, 64,000+ is the limit.

If you are stuffing an SQL string into a Row or Record
Source property, then the limit is 32,000+

(See Specifications in VBA Help)

Signature

Marsh
MVP [MS Access]

JimP - 27 Apr 2007 18:29 GMT
Is there a "standardized" way to break up a long SQL select statement, given
that " _" does not function as a line continuation for a string. e.g.

strSQL1 = "SELECT....."
strSQL2 = "FROM........"
strSQL =strSQL1 & strSQL2

>>Is there a 255 character limit to the length of a SQL SELECT statement in
>>VBA, e.g.
[quoted text clipped - 7 lines]
>
> (See Specifications in VBA Help)
John Spencer - 27 Apr 2007 19:26 GMT
StrSQL = "SELECT Field1, Field2, Field3 " & _
                      "Field4, Field5" & _
          " FROM NameYourPoison Inner Join" & _
          " OtherTable On NameYourPoison.ID = OtherTable.FID" & _
          " WHERE x = y"

Signature

John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
.

> Is there a "standardized" way to break up a long SQL select statement,
> given that " _" does not function as a line continuation for a string.
[quoted text clipped - 15 lines]
>>
>> (See Specifications in VBA Help)
Marshall Barton - 27 Apr 2007 20:02 GMT
Two common styles:

strSQL = "SELECT.....  " _
            & "FROM........"
or

strSQL = "SELECT.....  "
strSQL = strSQL & "FROM........"
Signature

Marsh
MVP [MS Access]

>Is there a "standardized" way to break up a long SQL select statement, given
>that " _" does not function as a line continuation for a string. e.g.
[quoted text clipped - 14 lines]
>>
>> (See Specifications in VBA Help)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.