Re: Why does cachesize > 1 skip records?? Bug??



gwhite1@xxxxxxxxx wrote:
I have a simple open and read code:

SQL$ = "SELECT I.IMS, d.ZIP, TERRS, SOURCE From rx_uf"
ads.CacheSize = 100
ads.Open SQL$, adb, adOpenForwardOnly, adLockOptimistic
'do stuff
ads.movenext

But this code skips records. When I change the cachesize to 1 it does
not skip records. Why would the cachesize > 1 skip records? Is there a
bug or something else I need to do to make it not skip records.

I cannot reproduce this. In a SQL Server 2005 database I have a table
called "Numbers" that contains a bunch of ... well ... numbers. 200 of
them as a matter of fact. I used this script to try to reproduce your
symptoms:

dim cn, rs, sql, fso,fil
set cn = createobject("adodb.connection")
cn.Open "provider=sqloledb;data source=clnsqldev;" & _
"initial catalog=test;user id=censored;password=censored"
sql="select refnum from numbers order by refnum"
set rs=createobject("adodb.recordset")
rs.CacheSize=100
rs.Open sql,cn,0,3,1
set fso=createobject("scripting.filesystemobject")
set fil=fso.OpenTextFile("numbers.txt",2,true)
do until rs.EOF
fil.writeline rs(0).Value
rs.MoveNext
loop
rs.Close:set rs=nothing
cn.Close:set cn=nothing
fil.close




--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


.



Relevant Pages

  • Re: Why does cachesize > 1 skip records?? Bug??
    ... When I change the cachesize to 1 it does ... Your sql statement has no ORDER ... Does adding ORDER BY stop the symptom? ... Please reply to the newsgroup. ...
    (microsoft.public.data.ado)
  • Why does cachesize > 1 skip records?? Bug??
    ... ads.Open SQL$, adb, adOpenForwardOnly, adLockOptimistic ... When I change the cachesize to 1 it does ... bug or something else I need to do to make it not skip records. ...
    (microsoft.public.data.ado)
  • Re: Problems with SQL MSDE after SBS SP1 upgrade!
    ... Thanks for updates. ... This newsgroup only focuses on SBS technical issues. ... | Subject: Re: Problems with SQL MSDE after SBS SP1 upgrade! ...
    (microsoft.public.windows.server.sbs)
  • RE: NOLOCK due to data movement
    ... It is unfortunate that you do not understand that this is an SBS problem. ... The default instance of SQL 2005 is working fine. ... Please understanding our newsgroup is mainly focused on SBS support. ... Microsoft CSS Online Newsgroup Support ...
    (microsoft.public.windows.server.sbs)
  • Re: Outputs into Word
    ... To get a sql output in word without using mail merge, write a batch file to spool the sql to a temp location on the users c:\ then get the spool file from the temp location to open in word. ... no need for a data source just basic logic. ... One last coment if I may though, I would like thank Cindy again for spending her time trying to resolve my query and also like to show my appreciation for my new found "newsgroup ethiquette". ...
    (microsoft.public.word.docmanagement)