MovePrevious don't work but the MoveNext work's fine 
Author Message
 MovePrevious don't work but the MoveNext work's fine

Hi
Does anyone know which of the CursorTypeEnum allow the moveprevious
method?
Because, I trying to use rs.moveprevious to show the previous record
as the result of this query:

Set Cn = New ADODB.Connection
Cn.ConnectionString = "provider=Microsoft.jet.oledb.4.0;Data Source="
& App.Path & "\gestmail.mdb"
Cn.Open
Set Rs10 = New ADODB.Recordset
Rs10.CursorLocation = adUseClient
Rs10.Open "[principal]", Cn, adOpenDynamic, adLockOptimistic,
adCmdTable
Set Rs10 = Cn.Execute(sqlstr$)
If Not Rs10.EOF Then
numreg = Rs10("reg_actual")
entidade = Rs10("entidade")
departamento = Rs10("departamento")
data = Rs10("data")
datadoc = Rs10("data_doc")
assunto = Rs10("assunto")
natureza = Rs10("natureza")
referencia = Rs10("referencia")
If Rs10("observacoes") <> "" Then
obs = Rs10("observacoes")
End If
Txt1.Text = data
Txt2.Text = numreg
Txt3.Text = departamento
Txt4.Text = entidade
Txt5.Text = referencia
Txt6.Text = datadoc
Txt7.Text = assunto
Txt8.Text = natureza
Txt9.Text = obs
End If
End Sub

Private Sub Cmd1_Click()
if not rs10.EOF then
Rs10.MovePrevious <-- error '3219' Operation is not allowed in this
context
end if
end Sub

Thanks!

    Pucca



Sun, 02 Oct 2005 19:04:06 GMT  
 MovePrevious don't work but the MoveNext work's fine
Hi Pucca, erase o delete this line of code,  Set Rs10 = Cn.Execute(sqlstr$),
and try again.

--
 Vctor Koch From Argentina.



Quote:
> Hi
> Does anyone know which of the CursorTypeEnum allow the moveprevious
> method?
> Because, I trying to use rs.moveprevious to show the previous record
> as the result of this query:

> Set Cn = New ADODB.Connection
> Cn.ConnectionString = "provider=Microsoft.jet.oledb.4.0;Data Source="
> & App.Path & "\gestmail.mdb"
> Cn.Open
> Set Rs10 = New ADODB.Recordset
> Rs10.CursorLocation = adUseClient
> Rs10.Open "[principal]", Cn, adOpenDynamic, adLockOptimistic,
> adCmdTable
> Set Rs10 = Cn.Execute(sqlstr$)
> If Not Rs10.EOF Then
> numreg = Rs10("reg_actual")
> entidade = Rs10("entidade")
> departamento = Rs10("departamento")
> data = Rs10("data")
> datadoc = Rs10("data_doc")
> assunto = Rs10("assunto")
> natureza = Rs10("natureza")
> referencia = Rs10("referencia")
> If Rs10("observacoes") <> "" Then
> obs = Rs10("observacoes")
> End If
> Txt1.Text = data
> Txt2.Text = numreg
> Txt3.Text = departamento
> Txt4.Text = entidade
> Txt5.Text = referencia
> Txt6.Text = datadoc
> Txt7.Text = assunto
> Txt8.Text = natureza
> Txt9.Text = obs
> End If
> End Sub

> Private Sub Cmd1_Click()
> if not rs10.EOF then
> Rs10.MovePrevious <-- error '3219' Operation is not allowed in this
> context
> end if
> end Sub

> Thanks!

>     Pucca



Mon, 03 Oct 2005 01:37:35 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Script works, script don't work

2. RS.MovePrevious / RS.Move(-2) doesn't work

3. some time's it works, some time it don't

4. I've programmed a game that don't work Help

5. ActiveX login doesn't work with WebBrowser control, but is fine in IE6

6. Minimize/maximize Form doesn't work fine...

7. ActiveX login doesn't work with WebBrowser control, but is fine in IE6

8. Platform Manager won't connect even though ActiveSync works fine

9. Function Dir don′t work fine

10. File search parameters don't work

11. String extract functions, left,right.mid don't work

12. [Views don't work]

 

 
Powered by phpBB® Forum Software