Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rowset Does Not support fetching backward

Status
Not open for further replies.

muraliambt

Programmer
Jan 22, 2002
75
0
0
US
Dear All,

Im using VB 6.0 and ORCALE 9i Lite Data base. I am getting the above mentioned error while try to Move backupward or Last record.

I have created the DSN=VBSIP (Oraclite ODBC Driver) which refers to my oracle lite database.

Here is the code.

Set sDBconn = New ADODB.Connection
sConnstring = "DSN=VBSIP;UID=USER;PWD=PWD"
sDBconn.Open sConnstring

This how i open my recordset.

RS.Open "select br_code, vou_curr_code, cv_serial_no, cv_date, max(amend_no) as amend_no from fom_cash_vou group by br_code, vou_curr_code, cv_serial_no, cv_date Order by br_code, vou_curr_code, cv_serial_no ", sDBconn, adOpenDynamic, adLockBatchOptimistic

I am able to move forward and move first record.

Thanks...
Muraliamabt.



 
Hi Guys..

Navigating through the Recordset got solved by putting

RS.CursorLocation = adUseClient

But another problem is, whenever i add any record to recordset (RS) it is adding but it is not adding the respective table ( fom_cash_vou ).

I thinks because Cursor Location = Client Side.

Is there any way to solve this problem. below is my data save code or Should i have to use SQL - INSERT COMMAND.

Please Advice..

Thanks.
Muraliambt.


private sub savedata()

Do Until Trow = FG1.Rows
If FG1.TextMatrix(Trow, 1) <> "" Then
''RsDet.AddNew
RS.AddNew

With RS
!ctry_code = "TNZ"
!comp_code = "01"
!br_code = br_code.Text
!pr_code = "00"
!cv_serial_no = vouno.Text
!cv_date = voudt.Value
!cur_code = cmbCurrency.Text
!line_no = Trow
!amend_no = 0
!exp_br_code = FG1.TextMatrix(Trow, 7)
!exp_pr_code = FG1.TextMatrix(Trow, 9)
!gl_code = FG1.TextMatrix(Trow, 1)
!sl_code = FG1.TextMatrix(Trow, 3)

!analysis_code = FG1.TextMatrix(Trow, 5)
'!ref_no = FG1.TextMatrix(Trow, 11)
!Description = FG1.TextMatrix(Trow, 14)

If Val(FG1.TextMatrix(Trow, 15)) <> 0 Then
!dr_cr = "D"
!amount = Val(Str(FG1.TextMatrix(Trow, 15)))
!acct_value = Val(Str(FG1.TextMatrix(Trow, 15)))
!bal_amount = Val(Str(FG1.TextMatrix(Trow, 15)))
End If

If Val(FG1.TextMatrix(Trow, 16)) <> 0 Then
!dr_cr = "C"
!amount = Val(Str(FG1.TextMatrix(Trow, 16)))
!acct_value = Val(Str(FG1.TextMatrix(Trow, 16)))
!bal_amount = Val(Str(FG1.TextMatrix(Trow, 16)))
End If

!forex_amount = 0
!exchg_Rate = Val(FG1.TextMatrix(Trow, 18))
!acc_period = "200512"
!user_id = "MURALI"
!snapshot_val = "TNZ01$&DARHO&DAR00&"
!last_updated_date = voudt.Value
!vou_curr_code = cmbCurrency.Text
!exchg_type = "USER"

End With
End If
Trow = Trow + 1
Loop

' Updates the Addtions/Changes in the Tables
RS.UpdateBatch adAffectAll

end sub.
 
Hi All,

I found the problem. For oracle lite we have to give commit exculsively..

conn.execute ("COMMIT").

it is working fine now.

Thanks
Muraliambt.



 
A little background: the default cursortype is ForwardOnly. Indeed, it doesn't support any functionality except movefirst and movenext. So, no fetching backward.

Now, the default cursorlocation is server side. When you set the location to client side, the only cursortype available is static, so the cursortype gets automatically set to static. If you want to keep your cursor on the server side, set the cursortype to something other than forwardonly if you want to support moveprevious and the like (in other words, if you want the rowset to support backward fetching).

HTH

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top