--0-460977022-1020925225=:66987
Content-Type: text/plain; charset=us-ascii
Dear Dr. Jaques:
Thank you so much! You are absolutely right. I often use adOpenDynamic.
I did not realize that I could get your wonderful help. I just deadly found some code in the internet to copy in my code:
'call function pub to exec the sp to see how many vendors for this code
call pubTwo ("spCodeVendor", session("SICID"))
set rstCV = server.CreateObject ("ADODB.Recordset")
with rstcv
.CursorType = adForwardOnly
.LockType = adLockReadOnly
.CursorLocation = adUseClient
end with
'this way to get the RecordCount (I did not know why until got your help)
rstcv.Open cmdCVTwo
counter=rstcv.RecordCount
Now I know why.
Thank you so much!!!!!!!!!!!
Best Regards!!!!!!!!!!!!!
Your student,
Peili Zhang
webmaster@w... wrote: Hey Peili,
If I am not mistaken, you are using the constant: adOpenDynamic to open the
Recordset, right -- Using that means that after you have called the db and
created a recordset, any changes made during this time by other people will be
seen in your recordset ?
Solution:
Instead of using adOpenDynamic try using adOpenStatic you are making the
recordset (yes you guessed it!) static, which means you can now use the
RecordCount method.
Hope it helps :)
Kind Regards,
Steffen Wogensen Jaques
>
> Dear Sir:
>
> I love your books very much!
>
> I have not taken the ASP class, but I need to write the ASP in my projects,
so I bought
the book, Beginning Active Server Pages 3.0. From learning the Chapter 15, I
quickly make
some ASP pages.
>
> Thank you so much!
>
> However, I met a problem: I don't know why my recordset cannot use the
RecordCount to get
the records number. Then, I study Chapter 13, 14, and see the RecordCount is
working
there.
>
> My ASP database is in the SQL Server, and I don't know why the RecordCount
alway is -1.
>
> So, I have to use loop to get the records number.
>
> Wish you can help me to tell me how I can make the RecordCount to work, not
using the
loop.
>
> Best Regards!!!
>
> Your reader,
>
> Peili Zhang
>
>
>
> ---------------------------------
> Do You Yahoo!?
> Yahoo! Games - play chess, backgammon, pool and more
>
>
---------------------------------------------
This message was sent using Endymion MailMan.
http://www.endymion.com/products/mailman/
---------------------------------
Do You Yahoo!?
Yahoo! Shopping - Mother's Day is May 12th!