Memo field and DAO 
Author Message
 Memo field and DAO

I'm using DAO 3.6 and I have a memo field that is in a dbReadForwardOnly
recordset that I want to access.  The problem appears to be that no matter
what I try the recordset fetch has truncated the Memo field to 255
characters.

I've tried looking at the 'note.FieldSize' and it's the right length.
However, when I try 'notes.GetChunk( x, y )' past 255 characters it is
always returning me a blank chunk.

Does anyone know of a way of accessing the entire contents of a Memo field
within VBA using DAO??  Ultimately what I'm trying to do is chunk up the
Memo field into individual strings so that it can be fetched in pieces by a
regular ODBC application.

Can anyone help?

Thanks in advance. =)



Mon, 20 May 2002 03:00:00 GMT  
 Memo field and DAO
On Thu, 2 Dec 1999 19:06:38 -0800, "Colin Ramsay"

Quote:

>However, when I try 'notes.GetChunk( x, y )' past 255 characters it is
>always returning me a blank chunk.

Works for me:

  Public Sub GetLongMemoDAO()

    Dim db As Database
    Dim rs As Recordset
    Dim strSQL As String

    Dim dwOffset As Long
    Dim strBuffer As String

    Const wBuffSize = 2048

    Set db = CurrentDb()
    strSQL = "select notes from colourtable where colourid = 1;"
    Set rs = db.OpenRecordset(strSQL, dbOpenSnapshot, dbForwardOnly)

    dwOffset = 0
    Do While True
      strBuffer = rs("Notes").GetChunk(dwOffset, wBuffSize)
      Debug.Print "Offset: " & dwOffset
      Debug.Print strBuffer
      Debug.Print

      dwOffset = dwOffset + Len(strBuffer)
      If Len(strBuffer) < wBuffSize Then Exit Do

    Loop

    rs.Close

  End Sub

Hope that helps

Quote:
>memo field that is in a dbReadForwardOnly
>recordset

By the way, what is a dbReadForwardOnly recordset??

Tim F

--



Wed, 22 May 2002 03:00:00 GMT  
 Memo field and DAO

Quote:
> By the way, what is a dbReadForwardOnly recordset??

One of the largest performance hits for any recordset retrieval
is that requirement of keeping a cursor handy which can be used
to scrool back and forth. If you are only ever going to scroll
through the recordset and nothing else, then it is faster to use
a "firehose" cursor as they are often called; this type of cursor
does not let you scroll backwards, you can only ever go forwards.
In DAO this refered to as a "forward only" recordset.

Note that in ADO this is the default (for perf reasons); in DAO
you do have to specify it. The theory behind this change in the
default behavior surrounds that fact that DAO's assumption was
that you would usually want to be able to scroll. In ADO, which
is designed with a web base in mind, the thinking is that data is
often read-only and read once, so it wants to use the quickest
option by default and then you can override it any time you want.

--
MichKa

don't ask by e-mail unless you're paying for it. (TANSTAAFL!) :-)

random junk of dubious value, a multilingual website, the
worldwide TSI Form/Report to Data Access Page Wizard,
and lots of replication "stuff" at http://www.trigeminal.com/



Wed, 22 May 2002 03:00:00 GMT  
 Memo field and DAO
DAO defines it. Now snapshots are *not* forward-only recordsets.
In DAO only recordsets with the constant are.

--
MichKa

don't ask by e-mail unless you're paying for it. (TANSTAAFL!) :-)

random junk of dubious value, a multilingual website, the
worldwide TSI Form/Report to Data Access Page Wizard,
and lots of replication "stuff" at http://www.trigeminal.com/


Quote:
> On Sat, 4 Dec 1999 06:26:53 -0800, "Michael (michka) Kaplan"

> >> By the way, what is a dbReadForwardOnly recordset??

> >In DAO this refered to as a "forward only" recordset.

> >Note that in ADO this is the default (for perf reasons); in
DAO
> >you do have to specify it.

> I know about forward only snapshots. I was asking where the
> "dbReadForwardOnly" contant came from..?

> TimF

> --




Thu, 23 May 2002 03:00:00 GMT  
 Memo field and DAO
On Sat, 4 Dec 1999 06:26:53 -0800, "Michael (michka) Kaplan"

Quote:

>> By the way, what is a dbReadForwardOnly recordset??

>In DAO this refered to as a "forward only" recordset.

>Note that in ADO this is the default (for perf reasons); in DAO
>you do have to specify it.

I know about forward only snapshots. I was asking where the
"dbReadForwardOnly" contant came from..?

TimF

--



Fri, 24 May 2002 03:00:00 GMT  
 Memo field and DAO
Hi,

Just in case some readers may not know it, in ADO, some providers allow a
.MoveFirst even on a firehose cursor which is not supposed to allow
scrolling backward ... but it is not a "move-back", it is a "fast" requery.
Just FYI.

Vanderghast, Access MVP.



Quote:


> > By the way, what is a dbReadForwardOnly recordset??

> One of the largest performance hits for any recordset retrieval
> is that requirement of keeping a cursor handy which can be used
> to scrool back and forth. If you are only ever going to scroll
> through the recordset and nothing else, then it is faster to use
> a "firehose" cursor as they are often called; this type of cursor
> does not let you scroll backwards, you can only ever go forwards.
> In DAO this refered to as a "forward only" recordset.

> Note that in ADO this is the default (for perf reasons); in DAO
> you do have to specify it. The theory behind this change in the
> default behavior surrounds that fact that DAO's assumption was
> that you would usually want to be able to scroll. In ADO, which
> is designed with a web base in mind, the thinking is that data is
> often read-only and read once, so it wants to use the quickest
> option by default and then you can override it any time you want.

> --
> MichKa

> don't ask by e-mail unless you're paying for it. (TANSTAAFL!) :-)

> random junk of dubious value, a multilingual website, the
> worldwide TSI Form/Report to Data Access Page Wizard,
> and lots of replication "stuff" at http://www.trigeminal.com/



Fri, 24 May 2002 03:00:00 GMT  
 Memo field and DAO
On Sun, 5 Dec 1999 19:27:01 -0800, "Michael (michka) Kaplan"

Quote:

>DAO defines it.

Funny. Couldn't find it in the Object Browser.

And I got this from the Immediate Window:

? dbReadForwardOnly

? len(dbReadForwardOnly)
 0

? isnull(dbReadForwardOnly)  
False

? len(dbReadForwardOnly) = ""
False

Anyone know what's going on here..?

Tim F

--



Fri, 24 May 2002 03:00:00 GMT  
 Memo field and DAO
It's a typo. Should be dbOpenForwardOnly


Quote:
> On Sun, 5 Dec 1999 19:27:01 -0800, "Michael (michka) Kaplan"

> >DAO defines it.

> Funny. Couldn't find it in the Object Browser.

> And I got this from the Immediate Window:

> ? dbReadForwardOnly

> ? len(dbReadForwardOnly)
>  0

> ? isnull(dbReadForwardOnly)
> False

> ? len(dbReadForwardOnly) = ""
> False

> Anyone know what's going on here..?

> Tim F

> --




Fri, 24 May 2002 03:00:00 GMT  
 Memo field and DAO
probably dbOpenForwardOnly


Quote:
> On Sun, 5 Dec 1999 19:27:01 -0800, "Michael (michka) Kaplan"

> >DAO defines it.

> Funny. Couldn't find it in the Object Browser.

> And I got this from the Immediate Window:

> ? dbReadForwardOnly

> ? len(dbReadForwardOnly)
>  0

> ? isnull(dbReadForwardOnly)
> False

> ? len(dbReadForwardOnly) = ""
> False

> Anyone know what's going on here..?

> Tim F

> --




Sat, 25 May 2002 03:00:00 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Problem With Memo Fields And DAO

2. Memo fields and DAO

3. Append memo field to a different memo field

4. Memo fields - problems reporting 2 memo fields

5. Access, VB, and DAO problem with a Memo Field

6. Help with Access Memo Field (DAO)

7. DAO.QuaryDef and Memo fields...HELP!!

8. Embed Fields within a memo field

9. HELP: linking txt field with a memo field

10. Displaying MS Access fields over 255 characters (Memo fields)

11. Mail Body field to Access memo field

12. get access-memo-field in an rtftext-field

 

 
Powered by phpBB® Forum Software