![]() |
|
|
+ Search |
![]()
|
Jul 19th, 2000 18:24
Chris Durkin,
Working with MS Access MEMO fields or SQL Server TEXT fields is very
error prone in ADO/ASP. Often the data will be truncated if you use the
default syntax:
stringvar = recordset.fields("longtext").value
The first thing to remember is always put the long text field last in
your SQL statement. There is a bug somewhere (ADO or SQL Server) which
causes data to be truncated otherwise.
Second, the most efficient way to process large amounts of string or
binary data in ADO/ASP is to use the GetChunk method of the Field
object. Here is an example:
set rst = conn.execute("select job_title, job_descr from jobs")
strTitle = rst.Fields("job_title").value & ""
vChunk = rst.Fields("job_descr").GetChunk(4000)
strDescr = vChunk
Do Until IsNull(vChunk) = true
vChunk = rst.Fields("job_descr").GetChunk(4000)
vDescr = vDescr & vChunk
Loop
response.write "Job Title: " & strTitle & "<br>"
response.write "Description: " & strDescr
© 1999-2004 Synop Pty Ltd