Adodc.recordset.update

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jun 2008
Posts: 11
Reputation: era_chatterbox is an unknown quantity at this point 
Solved Threads: 0
era_chatterbox's Avatar
era_chatterbox era_chatterbox is offline Offline
Newbie Poster

Adodc.recordset.update

 
0
  #1
Jun 25th, 2008
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...
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 2,131
Reputation: debasisdas will become famous soon enough debasisdas will become famous soon enough 
Solved Threads: 131
debasisdas's Avatar
debasisdas debasisdas is offline Offline
Postaholic

Re: Adodc.recordset.update

 
0
  #2
Jun 25th, 2008
simply try to use this format

  1. con.BegiTtrans 'con is the adodb connection object
  2. con.execute "your update statment ...."
  3. con.CommitTrans
Share your Knowledge.
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 848
Reputation: QVeen72 is on a distinguished road 
Solved Threads: 120
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Practically a Posting Shark

Re: Adodc.recordset.update

 
0
  #3
Jun 25th, 2008
Hi,

For the ADODC, have you set the Database and Record source property...?
And why "Update" without Addnew or Edit..?

Regards
Veena
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 11
Reputation: era_chatterbox is an unknown quantity at this point 
Solved Threads: 0
era_chatterbox's Avatar
era_chatterbox era_chatterbox is offline Offline
Newbie Poster

Re: Adodc.recordset.update

 
0
  #4
Jun 26th, 2008
To DebasisDas

Thanx for ur suggessions but...
M actually looking forward for something with adodc
i mean adodc.recordset.update query
so plz kindly help me out with that..

Regards
Era
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 11
Reputation: era_chatterbox is an unknown quantity at this point 
Solved Threads: 0
era_chatterbox's Avatar
era_chatterbox era_chatterbox is offline Offline
Newbie Poster

Re: Adodc.recordset.update

 
0
  #5
Jun 26th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 8
Reputation: raphaelsolis is an unknown quantity at this point 
Solved Threads: 0
raphaelsolis raphaelsolis is offline Offline
Newbie Poster

Re: Adodc.recordset.update

 
0
  #6
Jun 27th, 2008
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..
Last edited by raphaelsolis; Jun 27th, 2008 at 4:20 am. Reason: modified
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 11
Reputation: era_chatterbox is an unknown quantity at this point 
Solved Threads: 0
era_chatterbox's Avatar
era_chatterbox era_chatterbox is offline Offline
Newbie Poster

Re: Adodc.recordset.update

 
0
  #7
Jun 27th, 2008
Originally Posted by raphaelsolis View Post
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
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 2,131
Reputation: debasisdas will become famous soon enough debasisdas will become famous soon enough 
Solved Threads: 131
debasisdas's Avatar
debasisdas debasisdas is offline Offline
Postaholic

Re: Adodc.recordset.update

 
0
  #8
Jun 27th, 2008
i would still suggest o use ADODB objects
Share your Knowledge.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



Tag cloud for Visual Basic 4 / 5 / 6
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC