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;)
Printable View
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;)
How are you using it?
IE: what sql statement are you passeing to pen the recordsets?
I use below code loop the whole records
Code:<%
...
set RS = RS.NextRecordSet%>'Here get error
...
eh?
Yes but post the code you are using to create and open the recorsdset...
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
%>
AnyONE:rolleyes:
OR ANYBODY:confused:
The SQl you are pasiing only opens a single recordset...
So next recordset will not work..
I have set the RS.PageSize = Cint(PgSz)!
Are u MCSD?
:) :) :) :) :) ;) ;) ;) :rolleyes: :rolleyes: :rolleyes: :rolleyes:
Yes, ru?
What is meaning of "ru"?
are you?
I am not,even not a student of CS.:cool:
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
BUT i bet i have this code work fine when the database is sql server.
Anyhow,let me test your codes.;)
Your code give me another method of done this,thanx all.
At last, it seems ADO surport AbsolutePage in access database.;)