473,834 Members | 1,640 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

RUN TIME ERROR 2147217842(8004 0e4e)

DUNXALEARE
21 New Member
please help me.
im wrting a program using visual basic 6.0 and using ms access as data base.
when it ry to execute the program. and try to save record in database using adodc the system prompt me :
"Operation Cancelled" runtime error 2147217842(8004 0e4e)
i dont understand it and im sure that my coding is correct because it actually works smoothly for about 6 to 10 exucution or more and just encounter this problem for the first time
what shall i do.
please help me huhuhu :(
Mar 25 '07 #1
10 10361
ADezii
8,834 Recognized Expert Expert
please help me.
im wrting a program using visual basic 6.0 and using ms access as data base.
when it ry to execute the program. and try to save record in database using adodc the system prompt me :
"Operation Cancelled" runtime error 2147217842(8004 0e4e)
i dont understand it and im sure that my coding is correct because it actually works smoothly for about 6 to 10 exucution or more and just encounter this problem for the first time
what shall i do.
please help me huhuhu :(
Post the code. We cannot possibly attempt a solution without seeing it.
Mar 25 '07 #2
DUNXALEARE
21 New Member
Post the code. We cannot possibly attempt a solution without seeing it.
Expand|Select|Wrap|Line Numbers
  1. Private Sub saves_Click()
  2.  
  3. If act = 3 And cond = 1 Then
  4.     MsgBox "The record's identification code has been modified. System failed to update.", vbCritical, label
  5.     epis.Recordset.CancelUpdate: epis.Recordset.MoveFirst: educ.Recordset.MoveFirst: family.Recordset.MoveFirst
  6. End If
  7.  
  8. If act = 2 And cond = 1 Then
  9.         ans = MsgBox("Are you sure you want to save this record?", vbYesNo, label)
  10.  
  11.         If ans = vbYes Then
  12. 3:      educ.Recordset.MoveFirst: family.Recordset.MoveFirst: epis.Recordset.MoveFirst
  13.         MsgBox "You succesfully save the data", vbOKOnly, label: txt_no(0).Visible = True
  14.         Else: GoTo 4
  15.         End If
  16.  
  17. ElseIf act = 2 And cond = 0 Then
  18.     ansr = MsgBox("The employee you enter already exist. Would you like the record to display?", vbYesNo, label)
  19.  
  20.         If ansr = vbYes Then
  21.         act = 0: ans = txt_no(0).Text: epis.Recordset.CancelUpdate: educ.Recordset.CancelUpdate: family.Recordset.CancelUpdate: flag = False: saves.Enabled = flag: initialization: search
  22.         Else
  23.         epis.Recordset.CancelUpdate: educ.Recordset.CancelUpdate: family.Recordset.CancelUpdate
  24.         Exit Sub
  25.         End If
  26.  
  27. End If
  28. act = Empty: acts = Empty: Form_Load
  29. 4:
  30. End Sub
I dont put the other codes thats were the problem generates during run time
im using visual basic 6. 0
ms access 2003
thanx.
Mar 25 '07 #3
ADezii
8,834 Recognized Expert Expert
Expand|Select|Wrap|Line Numbers
  1. Private Sub saves_Click()
  2.  
  3. If act = 3 And cond = 1 Then
  4.     MsgBox "The record's identification code has been modified. System failed to update.", vbCritical, label
  5.     epis.Recordset.CancelUpdate: epis.Recordset.MoveFirst: educ.Recordset.MoveFirst: family.Recordset.MoveFirst
  6. End If
  7.  
  8. If act = 2 And cond = 1 Then
  9.         ans = MsgBox("Are you sure you want to save this record?", vbYesNo, label)
  10.  
  11.         If ans = vbYes Then
  12. 3:      educ.Recordset.MoveFirst: family.Recordset.MoveFirst: epis.Recordset.MoveFirst
  13.         MsgBox "You succesfully save the data", vbOKOnly, label: txt_no(0).Visible = True
  14.         Else: GoTo 4
  15.         End If
  16.  
  17. ElseIf act = 2 And cond = 0 Then
  18.     ansr = MsgBox("The employee you enter already exist. Would you like the record to display?", vbYesNo, label)
  19.  
  20.         If ansr = vbYes Then
  21.         act = 0: ans = txt_no(0).Text: epis.Recordset.CancelUpdate: educ.Recordset.CancelUpdate: family.Recordset.CancelUpdate: flag = False: saves.Enabled = flag: initialization: search
  22.         Else
  23.         epis.Recordset.CancelUpdate: educ.Recordset.CancelUpdate: family.Recordset.CancelUpdate
  24.         Exit Sub
  25.         End If
  26.  
  27. End If
  28. act = Empty: acts = Empty: Form_Load
  29. 4:
  30. End Sub
I must admit that I am having a little trouble following the Logic and Syntax of your code. This is only a suggestion, but before I do anything else, I woould write the code in a more logical, though longer, format:
Expand|Select|Wrap|Line Numbers
  1. Select Case act
  2.   Case 2
  3.     Select Case cond
  4.       Case 0
  5.         ansr = MsgBox("The employee you enter already exist. Would you like the record to display?", vbYesNo, Label)
  6.           If ansr = vbYes Then
  7.             act = 0
  8.             ans = txt_no(0).Text
  9.             epis.Recordset.CancelUpdate
  10.             educ.Recordset.CancelUpdate
  11.             family.Recordset.CancelUpdate
  12.             flag = False
  13.             saves.Enabled = flag
  14.             initialization
  15.             search
  16.           Else
  17.             epis.Recordset.CancelUpdate
  18.             educ.Recordset.CancelUpdate
  19.             family.Recordset.CancelUpdate
  20.               Exit Sub
  21.           End If
  22.       Case 1
  23.         ans = MsgBox("Are you sure you want to save this record?", vbYesNo, Label)
  24.           If ans = vbYes Then
  25.             educ.Recordset.MoveFirst
  26.             family.Recordset.MoveFirst
  27.             epis.Recordset.MoveFirst
  28.               MsgBox "You succesfully save the data", vbOKOnly, Label
  29.               txt_no(0).Visible = True
  30.           Else
  31.             GoTo 4
  32.           End If
  33.       Case Else
  34.         'act = 2 and cond <> 0 or 1
  35.     End Select
  36.   Case 3
  37.     If cond = 1 Then
  38.       MsgBox "The record's identification code has been modified. System failed to update.", vbCritical, Label
  39.       epis.Recordset.CancelUpdate
  40.       epis.Recordset.MoveFirst
  41.       educ.Recordset.MoveFirst
  42.       family.Recordset.MoveFirst
  43.     Else
  44.       'act = 3 and cond <> 1
  45.     End If
  46.   Case Else
  47.     'act <> 2 or 3
  48. End Select
  49.  
  50. act = Empty
  51. acts = Empty
  52. Form_Load
  53.  
  54. 4:
Mar 26 '07 #4
DUNXALEARE
21 New Member
I must admit that I am having a little trouble following the Logic and Syntax of your code. This is only a suggestion, but before I do anything else, I woould write the code in a more logical, though longer, format:
Expand|Select|Wrap|Line Numbers
  1. Select Case act
  2.   Case 2
  3.     Select Case cond
  4.       Case 0
  5.         ansr = MsgBox("The employee you enter already exist. Would you like the record to display?", vbYesNo, Label)
  6.           If ansr = vbYes Then
  7.             act = 0
  8.             ans = txt_no(0).Text
  9.             epis.Recordset.CancelUpdate
  10.             educ.Recordset.CancelUpdate
  11.             family.Recordset.CancelUpdate
  12.             flag = False
  13.             saves.Enabled = flag
  14.             initialization
  15.             search
  16.           Else
  17.             epis.Recordset.CancelUpdate
  18.             educ.Recordset.CancelUpdate
  19.             family.Recordset.CancelUpdate
  20.               Exit Sub
  21.           End If
  22.       Case 1
  23.         ans = MsgBox("Are you sure you want to save this record?", vbYesNo, Label)
  24.           If ans = vbYes Then
  25.             educ.Recordset.MoveFirst
  26.             family.Recordset.MoveFirst
  27.             epis.Recordset.MoveFirst
  28.               MsgBox "You succesfully save the data", vbOKOnly, Label
  29.               txt_no(0).Visible = True
  30.           Else
  31.             GoTo 4
  32.           End If
  33.       Case Else
  34.         'act = 2 and cond <> 0 or 1
  35.     End Select
  36.   Case 3
  37.     If cond = 1 Then
  38.       MsgBox "The record's identification code has been modified. System failed to update.", vbCritical, Label
  39.       epis.Recordset.CancelUpdate
  40.       epis.Recordset.MoveFirst
  41.       educ.Recordset.MoveFirst
  42.       family.Recordset.MoveFirst
  43.     Else
  44.       'act = 3 and cond <> 1
  45.     End If
  46.   Case Else
  47.     'act <> 2 or 3
  48. End Select
  49.  
  50. act = Empty
  51. acts = Empty
  52. Form_Load
  53.  
  54. 4:

well I admit reading my code is like walking in a maze :)
im not just familiar in using select case.
thanks for editing it folks.
it stil dont work. i already delete some records(until all of them) in data base to see if there is limitation in saving. I still encountered the the error.
Mar 26 '07 #5
ADezii
8,834 Recognized Expert Expert
well I admit reading my code is like walking in a maze :)
im not just familiar in using select case.
thanks for editing it folks.
it stil dont work. i already delete some records(until all of them) in data base to see if there is limitation in saving. I still encountered the the error.
Set a Breakpoint on Select Case act then single - step (F8) through the code. This will pinpoint the exact line that is causing the Error which is another reason why I did not place multiple Statements on a single line.
Mar 27 '07 #6
DUNXALEARE
21 New Member
Set a Breakpoint on Select Case act then single - step (F8) through the code. This will pinpoint the exact line that is causing the Error which is another reason why I did not place multiple Statements on a single line.


OK I get it .
Expand|Select|Wrap|Line Numbers
  1. Select Case act=2
  2. .
  3. .
  4. .....Select Case cond=1
  5.                 educ.recordset.movefirst
  6.                 family.recordset.movefirst
  7.                 epis.recordset.movefirst
  8. .
  9. .
  10. end select
  11. end select
  12.  
the epis.recordset. movefirst is highlighted when error occured.
all the fields connected to it dont save the data i entered, unlike the educ.recordset and family recordset.
Mar 27 '07 #7
marianoso
1 New Member
I reply to this thread althought is old, because it's the first goole result in this error and it's kinda frustrating to figure this problem out.

This error happens, amongst other reasons, because the SELECT statement that retrieves the data from the database, does not contain the whole primary key of the table. Somewhy, movefirst, movenext and other methods would fail in this situation, raising this crappy error message.

At least that happened to me, under MySql 5, with MyODBC and VB6 service pack 6.
Jan 9 '08 #8
ADezii
8,834 Recognized Expert Expert
OK I get it .
Expand|Select|Wrap|Line Numbers
  1. Select Case act=2
  2. .
  3. .
  4. .....Select Case cond=1
  5.                 educ.recordset.movefirst
  6.                 family.recordset.movefirst
  7.                 epis.recordset.movefirst
  8. .
  9. .
  10. end select
  11. end select
  12.  
the epis.recordset. movefirst is highlighted when error occured.
all the fields connected to it dont save the data i entered, unlike the educ.recordset and family recordset.
I'm printing all the code and taking it to work with me tomorrow. I'll get back to you on this.
Jan 10 '08 #9
srichey
2 New Member
In your code it seems to me that the rs.movefirst command is actually used to update the fields in the database with the new data.
Sugguestions:
Check to see if locktype is read-only
I am having a similar problem in DE and it is only when the locktype is read-only. And it only is happening when i have info placed in a combobox and the movefirst command is called.

???
Feb 12 '08 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

3
4932
by: sajithkahawatta | last post by:
i use asp then i got error Microsoft OLE DB Provider for ODBC Drivers error '80040e4e' Operation was canceled. /dbconn.asp, line 5 the code of dbconn.asp is, <%
0
1222
by: thethtwayag | last post by:
Hi, anyone out there for help. I am writing a program in vb6(sp6) using access as database. The program works well in the project as well as after compiling. But I receive RUN TIME ERROR 2147217842(80040e4e) when I try to install it in another computer. I have surfed enough to have informations but the problem still exits. Please if anyone can give the solution or direct me to a website explaining about that.
2
2716
by: hussainiyad | last post by:
Dear ADezii i,m totlally new for vb 6.0 and i,m doing a invoice project and i,m facing a issue , can you plz tell me solution i,m trying to retrive some datas from sql Product table it contains following fields ItemNo int,Descrption varchar(20),Supid int,SupName varchar(20),Purprice float,SalPrice float,QtyIn int,QtySold int i,m trying to retrive some datas from sql Product table
0
1603
by: hussainiyad | last post by:
Dear All i,m totlally new for vb 6.0 and i,m doing a invoice project and i,m facing a issue , can you plz tell me solution i,m trying to retrive some datas from sql (Product table) it contains following fields ItemNo varchar(10) 1.N1001
0
1133
by: hussainiyad | last post by:
Dear All, I,m doing a invoice project and in it i want to create both salesInvoice & purchase order my Purchaseinvoice table contains following fields 1.InvoiceNo int primary key 2.Pdate datetime 3.Supplier Id varchar(10)(This sup id should come from supplier table) 4.SupName(20)
0
1048
by: hussainiyad | last post by:
Dear All, I,m doing a invoice project and in it i want to create both salesInvoice & purchase order my Purchaseinvoice table contains following fields 1.InvoiceNo int primary key 2.Pdate datetime 3.Supplier Id varchar(10)(This sup id should come from supplier table) 4.SupName(20)
0
9797
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9644
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10793
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10219
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9331
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7757
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6954
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3977
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.