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 :(
10 10355 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.
Post the code. We cannot possibly attempt a solution without seeing it.
-
Private Sub saves_Click()
-
-
If act = 3 And cond = 1 Then
-
MsgBox "The record's identification code has been modified. System failed to update.", vbCritical, label
-
epis.Recordset.CancelUpdate: epis.Recordset.MoveFirst: educ.Recordset.MoveFirst: family.Recordset.MoveFirst
-
End If
-
-
If act = 2 And cond = 1 Then
-
ans = MsgBox("Are you sure you want to save this record?", vbYesNo, label)
-
-
If ans = vbYes Then
-
3: educ.Recordset.MoveFirst: family.Recordset.MoveFirst: epis.Recordset.MoveFirst
-
MsgBox "You succesfully save the data", vbOKOnly, label: txt_no(0).Visible = True
-
Else: GoTo 4
-
End If
-
-
ElseIf act = 2 And cond = 0 Then
-
ansr = MsgBox("The employee you enter already exist. Would you like the record to display?", vbYesNo, label)
-
-
If ansr = vbYes Then
-
act = 0: ans = txt_no(0).Text: epis.Recordset.CancelUpdate: educ.Recordset.CancelUpdate: family.Recordset.CancelUpdate: flag = False: saves.Enabled = flag: initialization: search
-
Else
-
epis.Recordset.CancelUpdate: educ.Recordset.CancelUpdate: family.Recordset.CancelUpdate
-
Exit Sub
-
End If
-
-
End If
-
act = Empty: acts = Empty: Form_Load
-
4:
-
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.
ADezii 8,834
Recognized Expert Expert -
Private Sub saves_Click()
-
-
If act = 3 And cond = 1 Then
-
MsgBox "The record's identification code has been modified. System failed to update.", vbCritical, label
-
epis.Recordset.CancelUpdate: epis.Recordset.MoveFirst: educ.Recordset.MoveFirst: family.Recordset.MoveFirst
-
End If
-
-
If act = 2 And cond = 1 Then
-
ans = MsgBox("Are you sure you want to save this record?", vbYesNo, label)
-
-
If ans = vbYes Then
-
3: educ.Recordset.MoveFirst: family.Recordset.MoveFirst: epis.Recordset.MoveFirst
-
MsgBox "You succesfully save the data", vbOKOnly, label: txt_no(0).Visible = True
-
Else: GoTo 4
-
End If
-
-
ElseIf act = 2 And cond = 0 Then
-
ansr = MsgBox("The employee you enter already exist. Would you like the record to display?", vbYesNo, label)
-
-
If ansr = vbYes Then
-
act = 0: ans = txt_no(0).Text: epis.Recordset.CancelUpdate: educ.Recordset.CancelUpdate: family.Recordset.CancelUpdate: flag = False: saves.Enabled = flag: initialization: search
-
Else
-
epis.Recordset.CancelUpdate: educ.Recordset.CancelUpdate: family.Recordset.CancelUpdate
-
Exit Sub
-
End If
-
-
End If
-
act = Empty: acts = Empty: Form_Load
-
4:
-
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: - Select Case act
-
Case 2
-
Select Case cond
-
Case 0
-
ansr = MsgBox("The employee you enter already exist. Would you like the record to display?", vbYesNo, Label)
-
If ansr = vbYes Then
-
act = 0
-
ans = txt_no(0).Text
-
epis.Recordset.CancelUpdate
-
educ.Recordset.CancelUpdate
-
family.Recordset.CancelUpdate
-
flag = False
-
saves.Enabled = flag
-
initialization
-
search
-
Else
-
epis.Recordset.CancelUpdate
-
educ.Recordset.CancelUpdate
-
family.Recordset.CancelUpdate
-
Exit Sub
-
End If
-
Case 1
-
ans = MsgBox("Are you sure you want to save this record?", vbYesNo, Label)
-
If ans = vbYes Then
-
educ.Recordset.MoveFirst
-
family.Recordset.MoveFirst
-
epis.Recordset.MoveFirst
-
MsgBox "You succesfully save the data", vbOKOnly, Label
-
txt_no(0).Visible = True
-
Else
-
GoTo 4
-
End If
-
Case Else
-
'act = 2 and cond <> 0 or 1
-
End Select
-
Case 3
-
If cond = 1 Then
-
MsgBox "The record's identification code has been modified. System failed to update.", vbCritical, Label
-
epis.Recordset.CancelUpdate
-
epis.Recordset.MoveFirst
-
educ.Recordset.MoveFirst
-
family.Recordset.MoveFirst
-
Else
-
'act = 3 and cond <> 1
-
End If
-
Case Else
-
'act <> 2 or 3
-
End Select
-
-
act = Empty
-
acts = Empty
-
Form_Load
-
-
4:
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: - Select Case act
-
Case 2
-
Select Case cond
-
Case 0
-
ansr = MsgBox("The employee you enter already exist. Would you like the record to display?", vbYesNo, Label)
-
If ansr = vbYes Then
-
act = 0
-
ans = txt_no(0).Text
-
epis.Recordset.CancelUpdate
-
educ.Recordset.CancelUpdate
-
family.Recordset.CancelUpdate
-
flag = False
-
saves.Enabled = flag
-
initialization
-
search
-
Else
-
epis.Recordset.CancelUpdate
-
educ.Recordset.CancelUpdate
-
family.Recordset.CancelUpdate
-
Exit Sub
-
End If
-
Case 1
-
ans = MsgBox("Are you sure you want to save this record?", vbYesNo, Label)
-
If ans = vbYes Then
-
educ.Recordset.MoveFirst
-
family.Recordset.MoveFirst
-
epis.Recordset.MoveFirst
-
MsgBox "You succesfully save the data", vbOKOnly, Label
-
txt_no(0).Visible = True
-
Else
-
GoTo 4
-
End If
-
Case Else
-
'act = 2 and cond <> 0 or 1
-
End Select
-
Case 3
-
If cond = 1 Then
-
MsgBox "The record's identification code has been modified. System failed to update.", vbCritical, Label
-
epis.Recordset.CancelUpdate
-
epis.Recordset.MoveFirst
-
educ.Recordset.MoveFirst
-
family.Recordset.MoveFirst
-
Else
-
'act = 3 and cond <> 1
-
End If
-
Case Else
-
'act <> 2 or 3
-
End Select
-
-
act = Empty
-
acts = Empty
-
Form_Load
-
-
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.
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.
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 . -
Select Case act=2
-
.
-
.
-
.....Select Case cond=1
-
educ.recordset.movefirst
-
family.recordset.movefirst
-
epis.recordset.movefirst
-
.
-
.
-
end select
-
end select
-
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 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.
ADezii 8,834
Recognized Expert Expert
OK I get it . -
Select Case act=2
-
.
-
.
-
.....Select Case cond=1
-
educ.recordset.movefirst
-
family.recordset.movefirst
-
epis.recordset.movefirst
-
.
-
.
-
end select
-
end select
-
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.
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.
???
Sign in to post your reply or Sign up for a free account.
Similar topics |
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,
<%
|
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.
|
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
|
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
|
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)
| |
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)
|
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...
|
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...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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...
| |
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...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
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
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |