" Run-time error '-2147217840(80040e4e)'

Error during database updation

Page 1 of 1

4 Replies - 4595 Views - Last Post: 21 November 2008 - 03:06 AM Rate Topic: -----

#1 realnapstar  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 18-November 08

" Run-time error '-2147217840(80040e4e)'

Post icon  Posted 18 November 2008 - 10:33 AM

hello all

i am facing a problem when i try to add new records in to data base. first of all my tech details are given below

Front end - vb 6
Back end - Microsoft SQL Server 2000

i am connecting to sql through ADODB connection ( through code ). my purpose is when i click on the "ok" button then the records entered in my form will add to the database. but when i click on the ok button then a errors comes saying

" Run-time error '-2147217840(80040e4e)'
operation was canceled "

and the error is highlighted in adorset.Move 0

my code is like this


   
	  If (MsgBox("Are You Sure? You Want to Save The Record?", vbYesNo) = vbYes) Then
   
	  adorset.Move 0
   
	  adorset.Update
   
	  MsgBox "Record Saved"
   
	  Call rsEmpC
   
	  Call constateC
   
	  Unload Me
   
	  End If
   
	  End Sub
  
	   


If (MsgBox("Are You Sure? You Want to Save The Record?", vbYesNo) = vbYes) Then adorset.Move 0 adorset.Update MsgBox "Record Saved" Call rsEmpC Call constateC Unload Me End If End Sub

one of the funniest thing is that if we press debug and run in regular base the record will be saved in to the table

please help me

Is This A Good Question/Topic? 0
  • +

Replies To: " Run-time error '-2147217840(80040e4e)'

#2 thava  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 180
  • View blog
  • Posts: 1,606
  • Joined: 17-April 07

Re: " Run-time error '-2147217840(80040e4e)'

Posted 18 November 2008 - 02:19 PM

may i know why should you call the move method before the update?

i am not sure
i think this will cause the error
Was This Post Helpful? 0
  • +
  • -

#3 realnapstar  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 18-November 08

Re: " Run-time error '-2147217840(80040e4e)'

Posted 19 November 2008 - 06:24 AM

View Postthava, on 18 Nov, 2008 - 01:19 PM, said:

may i know why should you call the move method before the update?

i am not sure
i think this will cause the error




thanks for your replay
i need "move 0" because of another error please check this link and help me to solve it

http://support.micro...com/kb/q195638/
Was This Post Helpful? 0
  • +
  • -

#4 thava  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 180
  • View blog
  • Posts: 1,606
  • Joined: 17-April 07

Re: " Run-time error '-2147217840(80040e4e)'

Posted 19 November 2008 - 10:48 PM

you have three resolution on that form note that the first one and try the third one i think it will solve the problem

look this link for how to use a cursor location and what is the need
http://www.vbforums....ad.php?t=399134
Was This Post Helpful? 0
  • +
  • -

#5 born2c0de  Icon User is offline

  • printf("I'm a %XR",195936478);
  • member icon

Reputation: 180
  • View blog
  • Posts: 4,667
  • Joined: 26-November 04

Re: " Run-time error '-2147217840(80040e4e)'

Posted 21 November 2008 - 03:06 AM

Does adorset.MoveFirst give you the same error?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1