473,790 Members | 2,617 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 2714
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
10353
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
1600
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
1131
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
1046
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
9511
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
10412
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
9986
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
9021
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
6769
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
5422
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
4093
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
3703
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
bsmnconsultancy
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...

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.