Results 1 to 16 of 16

Thread: RS.NextRecordSet method in ASP files.

  1. #1

    Thread Starter
    Fanatic Member dongaman's Avatar
    Join Date
    Aug 2001
    Location
    xi'an
    Posts
    616

    RS.NextRecordSet method in ASP files.

    HELLO,EVERY ONE
    Does RS.NextRecordSet method is Not Available when read ACCESS database.
    Here is the result I get.
    ErrNumber:0x800A0CB3
    ErrDescription:The operation requested by the application is not supported by the provider.
    THANX YOUR REPLY
    I am just aman.

  2. #2
    Fanatic Member
    Join Date
    Feb 2002
    Location
    SE England
    Posts
    732
    How are you using it?

    IE: what sql statement are you passeing to pen the recordsets?
    Leather Face is comin...


    MCSD

  3. #3

    Thread Starter
    Fanatic Member dongaman's Avatar
    Join Date
    Aug 2001
    Location
    xi'an
    Posts
    616
    I use below code loop the whole records
    Code:
    <%
    ...
    set RS = RS.NextRecordSet%>'Here get error
    ...
    I am just aman.

  4. #4
    Fanatic Member
    Join Date
    Feb 2002
    Location
    SE England
    Posts
    732
    eh?


    Yes but post the code you are using to create and open the recorsdset...
    Leather Face is comin...


    MCSD

  5. #5

    Thread Starter
    Fanatic Member dongaman's Avatar
    Join Date
    Aug 2001
    Location
    xi'an
    Posts
    616
    Code:
    <%
    Set DBConn = Server.CreateObject("ADODB.Connection")   
    DBConn.ConnectionTimeout = Session("DBConn_ConnectionTimeout")   
    DBConn.CommandTimeout = Session("DBConn_CommandTimeout")   
    DBConn.Open Session("DBConn_ConnectionString"), Session("DBConn_RuntimeUserName"), Session("DBConn_RuntimePassword")   
    Set cmdTemp = Server.CreateObject("ADODB.Command")   
    Set RS = Server.CreateObject("ADODB.Recordset")   
    cmdTemp.CommandType = 1   
    Set cmdTemp.ActiveConnection = DBConn          
    cmdTemp.CommandText = "SELECT * FROM ALLPRESENTATIONS WHERE NAME LIKE '%" & Keyword & "%'  OR DESCRIPTION LIKE '%" & Keyword & "%' OR COURSE LIKE '%" & Keyword & "%'"          
    RS.Open cmdTemp, ,1,3          
    
    Do while not (RS is nothing) 
    RowCount = RS.PageSize
    Do While Not RS.EOF and rowcount > 0 
    If n=1 then
    Response.Write "<TR BGCOLOR=#ffffee>"
    ELSE
    Response.Write "<TR BGCOLOR=#ffffee>"
    End If
    n=1-n
    %>
    <%=RS("Name")%> 
    <%
    RowCount = RowCount - 1
    RS.MoveNext 
    Loop
    set RS = RS.NextRecordSet
    Loop
    on error resume next
    RS.Close
    %>
    I am just aman.

  6. #6

    Thread Starter
    Fanatic Member dongaman's Avatar
    Join Date
    Aug 2001
    Location
    xi'an
    Posts
    616
    AnyONE
    I am just aman.

  7. #7

    Thread Starter
    Fanatic Member dongaman's Avatar
    Join Date
    Aug 2001
    Location
    xi'an
    Posts
    616
    OR ANYBODY
    I am just aman.

  8. #8
    Fanatic Member
    Join Date
    Feb 2002
    Location
    SE England
    Posts
    732
    The SQl you are pasiing only opens a single recordset...

    So next recordset will not work..
    Leather Face is comin...


    MCSD

  9. #9

    Thread Starter
    Fanatic Member dongaman's Avatar
    Join Date
    Aug 2001
    Location
    xi'an
    Posts
    616
    I have set the RS.PageSize = Cint(PgSz)!
    Are u MCSD?
    I am just aman.

  10. #10
    Fanatic Member
    Join Date
    Feb 2002
    Location
    SE England
    Posts
    732
    Yes, ru?
    Leather Face is comin...


    MCSD

  11. #11

    Thread Starter
    Fanatic Member dongaman's Avatar
    Join Date
    Aug 2001
    Location
    xi'an
    Posts
    616
    What is meaning of "ru"?
    I am just aman.

  12. #12
    Fanatic Member
    Join Date
    Feb 2002
    Location
    SE England
    Posts
    732
    are you?
    Leather Face is comin...


    MCSD

  13. #13

    Thread Starter
    Fanatic Member dongaman's Avatar
    Join Date
    Aug 2001
    Location
    xi'an
    Posts
    616
    I am not,even not a student of CS.
    I am just aman.

  14. #14
    Fanatic Member
    Join Date
    Feb 2002
    Location
    SE England
    Posts
    732
    PageSize does not work like that...

    See this example from MSDN:

    Code:
        'To integrate this code
        'replace the data source and initial catalog values
        'in the connection string
    
    Public Sub AbsolutePageX()
      
        'recordset and connection variables
    Dim rstEmployees As ADODB.Recordset
    Dim Cnxn As ADODB.Connection
    Dim strCnxn As String
    Dim strSQL As String
        'record variables
    Dim strMessage As String
    Dim intPage As Integer
    Dim intPageCount As Integer
    Dim intRecord As Integer
    
        'Open connection
        Set Cnxn = New ADODB.Connection
        strCnxn = "Provider=sqloledb;Data Source=MyServer;Initial Catalog=Pubs;User Id=sa;Password=;"
        Cnxn.Open strCnxn
        
       ' Open employee recordset
       ' Use client cursor to enable AbsolutePosition property
       Set rstEmployees = New ADODB.Recordset
       strSQL = "employee"
       rstEmployees.Open strSQL, strCnxn, adUseClient, adLockReadOnly, adCmdTable
       
       ' Display names and hire dates, five records at a time
       rstEmployees.PageSize = 5
       intPageCount = rstEmployees.PageCount
       For intPage = 1 To intPageCount
          rstEmployees.AbsolutePage = intPage
          strMessage = ""
          For intRecord = 1 To rstEmployees.PageSize
             strMessage = strMessage & _
                rstEmployees!fname & " " & _
                rstEmployees!lname & " " & _
                rstEmployees!hire_date & vbCr
             rstEmployees.MoveNext
             If rstEmployees.EOF Then Exit For
          Next intRecord
          MsgBox strMessage
       Next intPage
       
        ' clean up
       rstEmployees.Close
       Cnxn.Close
       Set rstEmployees = Nothing
       Set Cnxn = Nothing
    End Sub
    Leather Face is comin...


    MCSD

  15. #15

    Thread Starter
    Fanatic Member dongaman's Avatar
    Join Date
    Aug 2001
    Location
    xi'an
    Posts
    616
    BUT i bet i have this code work fine when the database is sql server.
    Anyhow,let me test your codes.
    I am just aman.

  16. #16

    Thread Starter
    Fanatic Member dongaman's Avatar
    Join Date
    Aug 2001
    Location
    xi'an
    Posts
    616
    Your code give me another method of done this,thanx all.
    At last, it seems ADO surport AbsolutePage in access database.
    I am just aman.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width