473,320 Members | 2,147 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Updating a records in VB.net using OLEdb

I have problem in updating my table in VB.net using oledbconnection.The table is created in MSAccess, on an button click event i add the records in the field for the first time,later i want to update the table for the same[ID for rest of the fiels.But i m unable to do so

Please help me with the solution
Nov 3 '06 #1
1 8188
try
dim ConnectionString as string="Provider .... dbase.mdb"

dim Query as string="Update table_name set field1=" & value & ", field2=" & value & ", ......, field(n)=" & value &" where id="& value & " "

dim Connection as new oledbconnection(ConnectionString)
Connection.open()

dim Command as new oledbcommand(Query,Connection)

Command.ExecuteNonQuery()

Messagebox.show("Ok")

Connection.Close()

Catch ex as Exception
Messagebox.show(ex.tostring())
Feb 11 '07 #2

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

Similar topics

3
by: Bernard André | last post by:
Hi All, context: I am using Access 97 tablkes with VB. I can see records in the MDB, using Adodc and datagrid. No problem. But when doing: rsprivate.AddNew rsprivate!For =...
2
by: dave | last post by:
Please help! I have spent all weekend trying to solve this and its driving me mad! I have a form with a datagrid on. When I click button btnNew, the new row appears in the datagrid but it does...
1
by: Harry Devine | last post by:
I have a DataGrid that is configured to use the Edit/Update/Cancel concept correctly. My grid shows values from 5 database fields. I only need to update that last 4 fields. The last field is a...
14
by: Lars Netzel | last post by:
A little background: I use three Datagrids that are in a child parent relation. I Use Negative Autoincrement on the the DataTables and that's workning nice. My problem is when I Update these...
13
by: Doug Bell | last post by:
Hi, I thought I had this sorted this morning but it is still a problem. My application has a DataAccess Class. When it starts, it: Connects to a DB (OLE DB) If it connects it uses an...
5
by: Hexman | last post by:
I've come up with an error which the solution eludes me. I get the error: >An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in HRTest.exe > >Additional...
5
by: JimmyKoolPantz | last post by:
Situation: I am writing a program that opens up a data file (file ext .dbf), imports the information into a dataset. The program also, searches through the dataset for key words ("company...
8
by: zandsc1 | last post by:
I'm fairly new to vb.net so any input is appreciated. I'm getting errors when I try to update the database using the following code: sql = "SELECT * FROM Employees WHERE Employee = '" &...
0
by: MightyFeldar | last post by:
I've looked just about everywhere and pieced together as best as I can the code to update the tracking number in a CSV file for an order that has shipped out from our company so we can upload the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.