Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Character limit in SQL propery of a QueryDef? 2

Status
Not open for further replies.

saraUSIT

Programmer
Jul 15, 2009
20
0
0
US
I'm trying to work with the sql property in a querydef but it seems like the sql keeps on getting truncated at around 250 characters- I know that the sql is somewhat lengthy, but I wanted to know if there was a way for the sql property to hold more than 250 characters? I am using the sql from the querydef in a variable in my code and then, if necessary (depending on other variables), adding some more criteria to the sql statement and then putting that back into the querydef before executing it. Any help in this matter is appreciated.
Thanks
 
the sql keeps on getting truncated at around 250 characters
Really ?
How did you do that ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
This is the beginning of my code:
Code:
Public Sub GetSkuSold(strQueryName As String)
Dim strSQL 
Dim origStrSQL As Variant, begStrSQL, endStrSQL, x, ctStrClause
Dim minDt, maxDt, intPos1 As Integer, intPos2 As Integer
   Dim ctCriteriaGrtr, ctCriteriaLess

Dim db As Database
Dim qd As DAO.QueryDef
Set db = CurrentDb
Set qd = db.QueryDefs(strQueryName)

origStrSQL = qd.sql
strSQL = origStrSQL
I was checking the variables in the locals screen and I noticed that the sql for the qd was not complete - it got truncated at around 250 characters from the sql statement that was in the query.
 
And what about this:
MsgBox origStrSQL
or this ?
Debug.Print origStrSQL

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thank you PHV and MajP - I got it to work! I didn't realize that the problem was just the locals screen... Thanks again for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top