473,803 Members | 2,937 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Run time error 2147217842(8004 0e4e)

31 New Member
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),Sup id int,SupName varchar(20),Pur price float,SalPrice float,QtyIn int,QtySold int

i,m trying to retrive some datas from sql Product table

in a Textbox

so

txtItem1.Text txtDes1.Text txtQty1.Text txtRate1.Text

txtItem2.Text txtDes2.Text txtQty2.Text txtRate2.Text

txtItem3.Text txtDes3.Text txtQty3.Text txtRate3.Text

so i write this coding in my txtItem_Clisk event

a = o
n = Val(txtItem1.Te xt)
adoproduct.Reco rdset.MoveFirst
Do While Not adoproduct.Reco rdset.EOF
If adoproduct.Reco rdset.Fields("I temNo") = Val(n) Then
txtDescrp1.Text = adoproduct.Reco rdset.Fields("D escrp")
txtPrice1.Text = adoproduct.Reco rdset.Fields("P urprice")
txtQty1.Text = adoproduct.Reco rdset.Fields("Q tyIn")
a = 1
End If
adoproduct.Reco rdset.MoveNext
Loop
If a = 0 Then
MsgBox "Item No Mismatch"
End If
adoproduct.Refr esh

and i used the same coding with changed the txtbox name in also other 2 txtbox click event

when i run my form it showed me the error msg

"Run time error 2147217842(8004 0e4e)
Opreation was canceled

and when i clicked the debug it showed me the
ItemNo,Purprice ,QtyIn and the Description column in sql automattically deleted, if i click the 2nd button it running fine

so whats the problem and how can i solve this

plz i need ur help
Apr 13 '08 #1
2 2715
debasisdas
8,127 Recognized Expert Expert

txtItem1.Text txtDes1.Text txtQty1.Text txtRate1.Text

txtItem2.Text txtDes2.Text txtQty2.Text txtRate2.Text

txtItem3.Text txtDes3.Text txtQty3.Text txtRate3.Text
What is this part of the code ?
Apr 14 '08 #2
hussainiyad
31 New Member
Thank U debi for ur kind reply i used the same coding for other two txtbox click event and this is my real problem

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
2.C909
3.F600

Descrption varchar(20)
Fan
Chair
Table

Supid int
1001
1009
1010
Purprice float
65.0
47.0
20.0

SalPrice float
75.0
55.0
30.0

QtyIn int
100
300
200


QtySold int
0
0
0

But i need some fileds only like ItemNo,Descrp,P urprice,QtyIn
and my Pinvoice form contains this
............... ............... ............... ............... ............... ............... ......
InvoiceNo-TextBox Date-TextBox

SupId-DataCombo SupName-Textbox
............... ............... ............... ............... ............... ............... ....
ItemNo (Label) Descrption (Label) Qty(Lable) Price(Lable) Gross (Lable Qty*Price)

txtItem1.Txt txtDescrp1.Text txtQty1.Text txtRate1.Text txtGross1.Txt

txtItem2.Txt txtDescrp2.Text txtQty2.Text txtRate2.Text txtGross2.Txt

txtItem3.Txt txtDescrp3.Text txtQty3.Text txtRate3.Text txtGross3.Txt

My option is when i type the ItemNo which is in Product table the corresponding Descrp&Purprice &QtyIn should be appear in the other textboxes,once i finish the first row then it,ll happen in another two rows

so in Textbox Click_event i write this codings

dim n as string, dim a as integer
[Adodc control name=adpproduct and i specify the connection and set the recordsource as table name=Product]
a = 0
n = txtItem1.Text
adoproduct.Reco rdset.MoveFirst
Do While Not adoproduct.Reco rdset.EOF
If adoproduct.Reco rdset.Fields("I temNo") = n Then
txtDescrp1.Text = adoproduct.Reco rdset.Fields("D escrp")
txtPrice1.Text = adoproduct.Reco rdset.Fields("P urprice")
txtQty1.Text = adoproduct.Reco rdset.Fields("Q tyIn")
a = 1
End If
adoproduct.Reco rdset.MoveNext
Loop
If a = 0 Then
MsgBox "Item No Mismatch"
End If
adoproduct.Refr esh

and i used the same coding with changed the txtbox name in also other 2 txtbox click event

when i run my form it showed me the error msg

"Run time error 2147217842(8004 0e4e)
Opreation was canceled

and when i clicked the debug it showed me the only the 2 fields of the Product table
ItemNo's N1001-Purprice 65,QtyIn 100 but Description column in sql automattically deleted from the table, and if i type the C909 in this txtbox with the same error msg it showed me the same value (65,100) if type the ItemNo in 2nd txtItem2.Text it showed me the error
but if i specify the itemNo as C909 in txtItem1.Text it didn't show me other column and directly goes to the EndIf statement and showed me the "Invalid ItemNo"Msgbox

so i take some datas from Product and insert in the new Pinvoice table


so whats the real problem and there is anything wrong in my coding plz tell me how can i solve this problem and instead of textbox how can i use datacombo to retrive the fields and what i should i do to solve this issue

plz i need ur help
Apr 14 '08 #3

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

Similar topics

3
4927
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, <%
10
10356
DUNXALEARE
by: DUNXALEARE | last post by:
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(80040e4e) 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...
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
1132
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
9703
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
10555
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
10317
jinu1996
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...
1
10300
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,...
0
10069
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
9127
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...
0
6844
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();...
0
5503
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...
1
4277
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 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.