Re: SLQ String Truncating in Code



Are you saying that the SQL is supposed to be 586 bytes, and it's being
truncated to something shorted (presumably 255 bytes), or is the SQL being
truncated to 586 bytes?

What version of Access are you using? If Access 2000 or newer, try changing
the following line in adhHandleQuotes

adhHandleQuotes = QUOTE & adhReplace(strValue, QUOTE, _
QUOTE & " & Chr$(34) & " & QUOTE) & QUOTE

to

adhHandleQuotes = QUOTE & Replace(strValue, QUOTE, _
QUOTE & " & Chr$(34) & " & QUOTE) & QUOTE

and get rid of the adhReplace function completely.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"vseale" <vseale@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:DDCCBEDF-05FE-49CE-9C06-43BFB13ADF34@xxxxxxxxxxxxxxxx
> Using a code example from Dev Ashish on the MPVS website (Simplify action
> queries in code), I'm attempting (being the operative word) to load a
> recordset when opening my form pulling the sql code stored in a table.
> The
> table field (SQLString) datatype is set as "Memo", but the code truncates
> the
> sql string (586 characters). The code is -
> Set db = CurrentDb
> Set rs = db.OpenRecordset("Select * from tblSQL where" _
> & " CalledFromProc='StoreSchedule'", dbOpenDynaset)
>
> With rs
> strSQL = adhHandleQuotes(!SQLString)
> db.Execute strSQL, dbFailOnError
> End With
>
> I'm using a DAO recordset. I've tried it with the function
> "adhHandleQuotes" and without, but the error box shows the sql string
> truncated both ways. Any suggestions? Thanks in advance for the help!
>


.