472,783 Members | 991 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,783 software developers and data experts.

Update Query

lea

i got this error msg while i trying to run the UPDATE query.there is n
underlying..

ERROR MSG :An unhandled exception of typ
'System.Data.OleDb.OleDbException' occurred in system.data.dll

----------------------------------------------------------------------------------------------------------------------------------------------------

CODE
Dim strSQL As String
strSQL = "UPDATE Item Master SET " & _
"Barcode = '" & txtBarcode.Text & "', Description= '"
txtItemDescription.Text & "', StandardCost= '" & txtStandardCost.Text
"', " & _
"RetailPrice= '" & txtRetailPrice.Text & "'
MinSellingPrice='" & txtMinSellingPrice.Text & "', StockQty ='"
txtStockQty.Text & "', " & _
"StockReorderLevel='" & txtStockReorder.Text & "' WHER
ItemCode = '" & txtItemCode.Text & "'"

Dim db As New OleDbCommand(strSQL, dc)
dc.Open()
db.ExecuteNonQuery()
MessageBox.Show("Record has been update successfully!", "Ite
Master", MessageBoxButtons.OK, MessageBoxIcon.Information

--
le
-----------------------------------------------------------------------
lea's Profile: http://www.msusenet.com/member.php?userid=156
View this thread: http://www.msusenet.com/t-187051013

Jul 21 '05 #1
2 1205
"lea" <le********@no-mx.msusenet.com> wrote in message
news:le********@no-mx.msusenet.com...

i got this error msg while i trying to run the UPDATE query.there is no
underlying..

ERROR MSG :An unhandled exception of type
'System.Data.OleDb.OleDbException' occurred in system.data.dll


Hi Lea,

I really can't tell what is wrong with your code. But I can tell you the
steps I would take to try to fix it:
-catch the exception that is being thrown that you are ignoring and see what
the message is
-when you are stepping through the debugger, get the generated SQL, and
attempt to run it in the databases native sql tool (Query Analyzer if using
SQLServer)

My guess is that you are generating an invalid sql statement, but check your
exception message before doing anything.

Good luck,
John MacIntyre
http://www.johnmacintyre.ca
Specializing in; Database, Web-Applications, and Windows Software
Jul 21 '05 #2
lea

i did write the error message in my 1st post, but i think u didnt notic
it. The Error MEssage is:"An unhandled exception of typ
'System.Data.OleDb.OleDbException' occurred in system.data.dll
". not much information about what is wrong with my coding. but INSER
INTO query has no problem.what's wrong :confused

--
le
-----------------------------------------------------------------------
lea's Profile: http://www.msusenet.com/member.php?userid=156
View this thread: http://www.msusenet.com/t-187051013

Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Surendra | last post by:
I have this query that I need to use in an Update statement to populate a field in the table by the value of Sq ---------------------------------------------------------------------------- Inline...
2
by: Mike Leahy | last post by:
Hello all, This question is related to updating tables - is there any way to calculate or update the values in a column in a table to the values in a field produced by a query result? An...
10
by: Randy Harris | last post by:
I imported records into a table, later found out that many of them had trailing spaces in one of the fields. If I'd caught it sooner, I could have trimmed the spaces before the import. This...
4
by: deko | last post by:
I'm trying to update the address record of an existing record in my mdb with values from another existing record in the same table. In pseudo code it might look like this: UPDATE tblAddress SET...
8
by: Maxi | last post by:
There is a lotto system which picks 21 numbers every day out of 80 numbers. I have a table (name:Lotto) with 22 fields (name:Date,P1,P2....P21) Here is the structure and sample data: ...
7
by: Mark Carlyle via AccessMonster.com | last post by:
I have this update query that I am trying to run. I know the syntax is messed up but do not know how to correct it. Select 'UPDATE', Transactions,'Set = where = ' From "Get Daily Balances" ...
3
by: Shapper | last post by:
Hello, I have created 3 functions to insert, update and delete an Access database record. The Insert and the Delete code are working fine. The update is not. I checked and my database has all...
31
by: Lag | last post by:
Having a problem updating my database from a web page, through a submission form. Can anyone help? ----THIS IS MY CODE IN update.php----(user, pass, and database are typed in directly, I...
3
by: eholz1 | last post by:
Hello PHP programmers. I had a brilliant idea on one of my pages that selects some data from my mysql database. I first set the page up to display some info and an image, just one item, with a...
16
by: ARC | last post by:
Hello all, So I'm knee deep in this import utility program, and am coming up with all sorts of "gotcha's!". 1st off. On a "Find Duplicates Query", does anyone have a good solution for...
0
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

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.