|
-
Nov 7th, 2002, 04:12 AM
#1
Thread Starter
Fanatic Member
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
-
Nov 7th, 2002, 04:18 AM
#2
Fanatic Member
How are you using it?
IE: what sql statement are you passeing to pen the recordsets?
Leather Face is comin...
MCSD
-
Nov 7th, 2002, 04:21 AM
#3
Thread Starter
Fanatic Member
I use below code loop the whole records
Code:
<%
...
set RS = RS.NextRecordSet%>'Here get error
...
-
Nov 7th, 2002, 04:22 AM
#4
Fanatic Member
eh?
Yes but post the code you are using to create and open the recorsdset...
Leather Face is comin...
MCSD
-
Nov 7th, 2002, 04:29 AM
#5
Thread Starter
Fanatic Member
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
%>
-
Nov 7th, 2002, 05:08 AM
#6
Thread Starter
Fanatic Member
AnyONE
-
Nov 7th, 2002, 05:56 AM
#7
Thread Starter
Fanatic Member
OR ANYBODY
-
Nov 7th, 2002, 05:57 AM
#8
Fanatic Member
The SQl you are pasiing only opens a single recordset...
So next recordset will not work..
Leather Face is comin...
MCSD
-
Nov 7th, 2002, 06:05 AM
#9
Thread Starter
Fanatic Member
-
Nov 7th, 2002, 06:08 AM
#10
Fanatic Member
Leather Face is comin...
MCSD
-
Nov 7th, 2002, 06:09 AM
#11
Thread Starter
Fanatic Member
-
Nov 7th, 2002, 06:11 AM
#12
Fanatic Member
Leather Face is comin...
MCSD
-
Nov 7th, 2002, 06:13 AM
#13
Thread Starter
Fanatic Member
I am not,even not a student of CS.
-
Nov 7th, 2002, 06:19 AM
#14
Fanatic Member
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
-
Nov 7th, 2002, 06:25 AM
#15
Thread Starter
Fanatic Member
BUT i bet i have this code work fine when the database is sql server.
Anyhow,let me test your codes.
-
Nov 7th, 2002, 06:55 AM
#16
Thread Starter
Fanatic Member
Your code give me another method of done this,thanx all.
At last, it seems ADO surport AbsolutePage in access database.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|