| | |
Adodc.recordset.update
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
dear frnz...
There is some problem in d code in one of my form...
m having a table as Billable in oracle db. M using Oracle 10g.
M done with the coding part..i mean all kinda validations
bt when i try to save the data in table..it gives me the error as
"Object variable or with block variable not set"
and when i debug the program it gives me error in ADODC.RECORDSET.UPDATE
I had checked the connction string and recordsource, they are correct.
Can anyone please temme where m wrong.
Here is d code of my form:
cmdblogout.Enabled = True
cmdbsearch.Enabled = True
cmdbadd.Enabled = True
cmdbedit.Enabled = True
cmdbfirst.Enabled = True
cmdbprev.Enabled = True
cmdbnext.Enabled = True
cmdblast.Enabled = True
cmdbsave.Enabled = False
cmdbcncl.Enabled = False
cmdbexit.Enabled = False
Adodc3.Recordset.Update
frmb.Enabled = False
Adodc3.RecordSource = "select * from billable"
Adodc3.Refresh
Thanx in advance...
I hope my problem is clear to u ppl...
There is some problem in d code in one of my form...
m having a table as Billable in oracle db. M using Oracle 10g.
M done with the coding part..i mean all kinda validations
bt when i try to save the data in table..it gives me the error as
"Object variable or with block variable not set"
and when i debug the program it gives me error in ADODC.RECORDSET.UPDATE
I had checked the connction string and recordsource, they are correct.
Can anyone please temme where m wrong.
Here is d code of my form:
cmdblogout.Enabled = True
cmdbsearch.Enabled = True
cmdbadd.Enabled = True
cmdbedit.Enabled = True
cmdbfirst.Enabled = True
cmdbprev.Enabled = True
cmdbnext.Enabled = True
cmdblast.Enabled = True
cmdbsave.Enabled = False
cmdbcncl.Enabled = False
cmdbexit.Enabled = False
Adodc3.Recordset.Update
frmb.Enabled = False
Adodc3.RecordSource = "select * from billable"
Adodc3.Refresh
Thanx in advance...
I hope my problem is clear to u ppl...
simply try to use this format
vb Syntax (Toggle Plain Text)
con.BegiTtrans 'con is the adodb connection object con.execute "your update statment ...." con.CommitTrans
Share your Knowledge.
Dear Veena
M done with the property part of ADODC
i.e. by setting recordsource and connection string
m here using adodc.recordset.update under the SAVE BUTTON
in ADD button, i did recordset.addnew
here is the code :
Private Sub cmdbadd_Click()
'----------------------------Billable add btn--------------------------
cmdblogout.Enabled = False
cmdbsearch.Enabled = False
cmdbadd.Enabled = False
cmdbedit.Enabled = False
cmdbfirst.Enabled = False
cmdbprev.Enabled = False
cmdbnext.Enabled = False
cmdblast.Enabled = False
cmdbsave.Enabled = True
cmdbcncl.Enabled = True
cmdbexit.Enabled = True
frmb.Enabled = True
Adodc3.Recordset.AddNew
End Sub
Private Sub cmdbcncl_Click()
'----------------------------Billable cancel btn--------------------------
cmdblogout.Enabled = True
cmdbsearch.Enabled = True
cmdbadd.Enabled = True
cmdbedit.Enabled = True
cmdbfirst.Enabled = True
cmdbprev.Enabled = True
cmdbnext.Enabled = True
cmdblast.Enabled = True
cmdbsave.Enabled = False
cmdbcncl.Enabled = False
cmdbexit.Enabled = True
frmb.Enabled = False
Adodc3.RecordSource = "select * from billable"
Adodc3.Refresh
End Sub
Private Sub cmdbedit_Click()
'----------------------------Billable edit btn--------------------------
cmdblogout.Enabled = False
cmdbsearch.Enabled = False
cmdbadd.Enabled = False
cmdbedit.Enabled = False
cmdbfirst.Enabled = False
cmdbprev.Enabled = False
cmdbnext.Enabled = False
cmdblast.Enabled = False
cmdbsave.Enabled = True
cmdbcncl.Enabled = True
cmdbexit.Enabled = True
frmb.Enabled = True
End Sub
Private Sub cmdbfirst_Click()
'----------------------------Billable first btn--------------------------
Adodc3.Recordset.MoveFirst
End Sub
Private Sub cmdblast_Click()
'----------------------------Billable last btn--------------------------
Adodc3.Recordset.MoveLast
End Sub
Private Sub cmdbnext_Click()
'----------------------------Billable next btn--------------------------
Adodc3.Recordset.MoveNext
If Adodc3.Recordset.EOF Then
Adodc3.Recordset.MoveLast
End If
End Sub
Private Sub cmdbprev_Click()
'----------------------------Billable previous btn--------------------------
Adodc3.Recordset.MovePrevious
If Adodc3.Recordset.BOF = True Then
Beep
Beep
Beep
Beep
Adodc3.Recordset.MoveFirst
End If
End Sub
I think the above code is correct...but if u think there is some prob..then plz do lemme knw
Love
Era
M done with the property part of ADODC
i.e. by setting recordsource and connection string
m here using adodc.recordset.update under the SAVE BUTTON
in ADD button, i did recordset.addnew
here is the code :
Private Sub cmdbadd_Click()
'----------------------------Billable add btn--------------------------
cmdblogout.Enabled = False
cmdbsearch.Enabled = False
cmdbadd.Enabled = False
cmdbedit.Enabled = False
cmdbfirst.Enabled = False
cmdbprev.Enabled = False
cmdbnext.Enabled = False
cmdblast.Enabled = False
cmdbsave.Enabled = True
cmdbcncl.Enabled = True
cmdbexit.Enabled = True
frmb.Enabled = True
Adodc3.Recordset.AddNew
End Sub
Private Sub cmdbcncl_Click()
'----------------------------Billable cancel btn--------------------------
cmdblogout.Enabled = True
cmdbsearch.Enabled = True
cmdbadd.Enabled = True
cmdbedit.Enabled = True
cmdbfirst.Enabled = True
cmdbprev.Enabled = True
cmdbnext.Enabled = True
cmdblast.Enabled = True
cmdbsave.Enabled = False
cmdbcncl.Enabled = False
cmdbexit.Enabled = True
frmb.Enabled = False
Adodc3.RecordSource = "select * from billable"
Adodc3.Refresh
End Sub
Private Sub cmdbedit_Click()
'----------------------------Billable edit btn--------------------------
cmdblogout.Enabled = False
cmdbsearch.Enabled = False
cmdbadd.Enabled = False
cmdbedit.Enabled = False
cmdbfirst.Enabled = False
cmdbprev.Enabled = False
cmdbnext.Enabled = False
cmdblast.Enabled = False
cmdbsave.Enabled = True
cmdbcncl.Enabled = True
cmdbexit.Enabled = True
frmb.Enabled = True
End Sub
Private Sub cmdbfirst_Click()
'----------------------------Billable first btn--------------------------
Adodc3.Recordset.MoveFirst
End Sub
Private Sub cmdblast_Click()
'----------------------------Billable last btn--------------------------
Adodc3.Recordset.MoveLast
End Sub
Private Sub cmdbnext_Click()
'----------------------------Billable next btn--------------------------
Adodc3.Recordset.MoveNext
If Adodc3.Recordset.EOF Then
Adodc3.Recordset.MoveLast
End If
End Sub
Private Sub cmdbprev_Click()
'----------------------------Billable previous btn--------------------------
Adodc3.Recordset.MovePrevious
If Adodc3.Recordset.BOF = True Then
Beep
Beep
Beep
Beep
Adodc3.Recordset.MoveFirst
End If
End Sub
I think the above code is correct...but if u think there is some prob..then plz do lemme knw
Love
Era
•
•
Join Date: Jun 2008
Posts: 8
Reputation:
Solved Threads: 0
hello can u try putting 2 adodc.refresh to your form load and on your update button.. sometimes in vb6 one adodc.refresh is not enough that's why you got that error..
also before the addnew please put also 2 adodc.refresh..
try it and see if it works..
also before the addnew please put also 2 adodc.refresh..
try it and see if it works..
Last edited by raphaelsolis; Jun 27th, 2008 at 4:20 am. Reason: modified
•
•
•
•
hello can u try putting 2 adodc.refresh to your form load and on your update button.. sometimes in vb6 one adodc.refresh is not enough that's why you got that error..
also before the addnew please put also 2 adodc.refresh..
try it and see if it works..
hey thanx 4 ur suggession..it really work...
well even i did smthing by myself also..
i change the code
adodc3.recordset.update
to
adodc3.recordset.addnew
But can anyone plz suggest me...how to use
adodc.recordset.update code..u cn check my code in above posts
my task is to update the details entered in the form thru adodc.recordset.update
Is there any other query to update the record
M using Oracle 10g...kindly plz dont suggest me anything related with access
Thanx
Era
![]() |
Similar Threads
- accessing ms access from VB (Visual Basic 4 / 5 / 6)
- insert into sql select statement (Visual Basic 4 / 5 / 6)
- Adding record in tables which has relationships (Visual Basic 4 / 5 / 6)
- Listbox, ADODC (Visual Basic 4 / 5 / 6)
- Refresh adodc (Visual Basic 4 / 5 / 6)
- Database question.. Can someone help... (Database Design)
- Access and VB (Visual Basic 4 / 5 / 6)
- How can I refresh DataBase without closing Form Attached with my Coding (Visual Basic 4 / 5 / 6)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Code for restart/shut down PC
- Next Thread: mini project
| Thread Tools | Search this Thread |
Tag cloud for Visual Basic 4 / 5 / 6
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time timer urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






