I am unable to get all the records from the recordset. Please guide.
I get only "White" for nine time. Please help
+++++++++++++++++++++++++++++++++++++++++++++
method in my component - mymts:
Public Function ReturnRs(strConnect As Variant, strSQL As Variant) _
As ADODB.Recordset
'Returns an ADODB recordset.
On Error GoTo ehGetRecordset
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
cn.Open strConnect
'These are not listed in the typelib.
rs.CursorLocation = adUseClient
'Using the Unspecified parameters, an ADO/R recordset is
returned.
rs.Open strSQL, cn
Set ReturnRs = rs
Exit Function
ehGetRecordset:
Err.Raise Err.Number, Err.Source, Err.Description
End Function
Asp file:
<%@ Language=VBScript Transaction=Required %>
<%
set ObjContext = ObjectContext
set objAccount = createObject("mymts.resultset")
rs = OBJACCOUNT.ReturnRs
("Provider=SQLOLEDB;server=sqlserver;database=pubs;user
id=sa;pwd=mypwd;", "Select * from authors")
for each obj in rs
Response.Write rs(1)& "<br>"
next
set con1 = nothing
set rs1 = nothing
%>
------------------------ Yahoo! Groups Sponsor --------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/17folB/TM
--------------------------------------------------------------------~->
---------------------------------------------------------------------
Home : http://groups.yahoo.com/group/active-server-pages
---------------------------------------------------------------------
Post : [EMAIL PROTECTED]
Subscribe : [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
---------------------------------------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/active-server-pages/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/