J
Jonathan
Hi, using Access 2003 and sql2005. I would like to have a recordset that I
can navigate forwards and back, and get the record count using the following
code (snippet)...
conn.ConnectionString = "DSN=MATohbData"
conn.Open
Set cmd.ActiveConnection = conn
cmd.CommandTimeout = 300
cmd.CommandText = "spl_PostnatalCombined"
cmd.CommandType = adCmdStoredProc
With rs
.CursorLocation = adUseClient
.CursorType = adOpenStatic
End With
Set rs = cmd.Execute
rs.MoveFirst
rs.MoveNext
rs.MoveLast
rs.MovePrevious
Debug.Print rs.RecordCount
Debug.Print rs.MaxRecords
....
rs.movefirst and rs.movenext are ok. rs.movelast and rs.moveprevious trigger
an error.
rs.recordcount = 0
rs.maxrecords = -1
The recordset should contain 7 records. I have tried other curser types
without success.
Any ideas or suggestions appreciated
Many thanks,
Jonathan
can navigate forwards and back, and get the record count using the following
code (snippet)...
conn.ConnectionString = "DSN=MATohbData"
conn.Open
Set cmd.ActiveConnection = conn
cmd.CommandTimeout = 300
cmd.CommandText = "spl_PostnatalCombined"
cmd.CommandType = adCmdStoredProc
With rs
.CursorLocation = adUseClient
.CursorType = adOpenStatic
End With
Set rs = cmd.Execute
rs.MoveFirst
rs.MoveNext
rs.MoveLast
rs.MovePrevious
Debug.Print rs.RecordCount
Debug.Print rs.MaxRecords
....
rs.movefirst and rs.movenext are ok. rs.movelast and rs.moveprevious trigger
an error.
rs.recordcount = 0
rs.maxrecords = -1
The recordset should contain 7 records. I have tried other curser types
without success.
Any ideas or suggestions appreciated
Many thanks,
Jonathan