473,662 Members | 2,413 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Newbie - Updating a record

I am new to VB.2005 and to make it worse, I'm switching over from VB 6.0. I
have figured out how to programmaticall y Create a Database and Table and how
to add data to an Access database (Two weeks work). I'm having trouble
trying to figure out how to Update and Delete a record (Row) from an
existing database. I'm finished with trying to find help using Google.
Everyone wants me to join their group so I can get the answer and when I do,
all they do is ask me more questions or refer me to a link that sends me to
another group that wants me to join their group. The record has three simple
fields. Nothing complicated. Is there a big secret that VB.NET programmers
are keeping to themselves? When I try to update, everything seems to work
but it doesn't make the changes in the database. Can someone
help......Pleas e?

MooVBuff
Jun 27 '08 #1
4 981
"MooVBuff" <ed*****@comcas t.netschrieb
I am new to VB.2005 and to make it worse, I'm switching over from VB
6.0. I have figured out how to programmaticall y Create a Database
and Table and how to add data to an Access database (Two weeks
work). I'm having trouble trying to figure out how to Update and
Delete a record (Row) from an existing database. I'm finished with
trying to find help using Google. Everyone wants me to join their
group so I can get the answer and when I do, all they do is ask me
more questions or refer me to a link that sends me to another group
that wants me to join their group. The record has three simple
fields. Nothing complicated. Is there a big secret that VB.NET
programmers are keeping to themselves? When I try to update,
everything seems to work but it doesn't make the changes in the
database. Can someone
help......Pleas e?
Already had a look in the documentation and the contained examples?
Short story: You need a connection to the database and an SQL to update
the data. Translated:

Dim con As New OleDbConnection ("<connectionst ring>")
Dim cmd As New OleDbCommand("u pdate table set f1=? where id=?",
con)

con.Open()

With cmd.Parameters
.AddWithValue(" f1", "new content")
.AddWithValue(" id", 17)
End With

cmd.ExecuteNonQ uery()

Where do you have the data in memory? Dataset/Datatable? Then read the
chapters covering the usage of Datasets. One starting point:
http://msdn.microsoft.com/en-us/libr...ez(VS.80).aspx

Armin

Jun 27 '08 #2
MooVBuff,

The fact that you are using Access, along with your remark that the update
seems to work but the changes don't appear in the database leads me to wonder
if you are actually updating a copy of the database:

http://msdn2.microsoft.com/en-us/library/ms246989.aspx

Kerry Moorman
"MooVBuff" wrote:
I am new to VB.2005 and to make it worse, I'm switching over from VB 6.0. I
have figured out how to programmaticall y Create a Database and Table and how
to add data to an Access database (Two weeks work). I'm having trouble
trying to figure out how to Update and Delete a record (Row) from an
existing database. I'm finished with trying to find help using Google.
Everyone wants me to join their group so I can get the answer and when I do,
all they do is ask me more questions or refer me to a link that sends me to
another group that wants me to join their group. The record has three simple
fields. Nothing complicated. Is there a big secret that VB.NET programmers
are keeping to themselves? When I try to update, everything seems to work
but it doesn't make the changes in the database. Can someone
help......Pleas e?

MooVBuff
Jun 27 '08 #3
MooVBuff wrote:
When I try to update, everything seems to work
but it doesn't make the changes in the database. Can someone
help......Pleas e?
Not nearly enough information to provide any help on. "When I try to update.." -
what are you trying?
Jun 27 '08 #4
DUHHHH. This exactly what I'm talking about. Everyone has a comment but
no-one seems to know how to do it. Thanks to Armin Zingler for pointing me
to material that really helped.
"Kerry Moorman" <Ke**********@d iscussions.micr osoft.comwrote in message
news:03******** *************** ***********@mic rosoft.com...
MooVBuff,

The fact that you are using Access, along with your remark that the update
seems to work but the changes don't appear in the database leads me to
wonder
if you are actually updating a copy of the database:

http://msdn2.microsoft.com/en-us/library/ms246989.aspx

Kerry Moorman
"MooVBuff" wrote:
>I am new to VB.2005 and to make it worse, I'm switching over from VB 6.0.
I
have figured out how to programmaticall y Create a Database and Table and
how
to add data to an Access database (Two weeks work). I'm having trouble
trying to figure out how to Update and Delete a record (Row) from an
existing database. I'm finished with trying to find help using Google.
Everyone wants me to join their group so I can get the answer and when I
do,
all they do is ask me more questions or refer me to a link that sends me
to
another group that wants me to join their group. The record has three
simple
fields. Nothing complicated. Is there a big secret that VB.NET
programmers
are keeping to themselves? When I try to update, everything seems to work
but it doesn't make the changes in the database. Can someone
help......Plea se?

MooVBuff

Jun 27 '08 #5

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

Similar topics

11
16158
by: Jason | last post by:
Let's say I have an html form with 20 or 30 fields in it. The form submits the fields via POST to a php page which updates a table in a database with the $_POST vars. Which makes more sense? 1) simply UPDATING the values for all fields in the table, whether or not any particular field has actually changed 2) running a second SELECT statement and comparing the $_POST vars to the returned values, and only UPDATING those that have...
1
1860
by: Chris Jackson | last post by:
I'm a novice Access user and am not sure how to solve the following problem. Any help with the following would be greatly appreciated! I have two tables with identical structures, the first holds the data input for a questionnaire, the second holds the scores from the questionnaire, to move the scores I've set up 2 action queries, the first appends the record to the second table, the second action query 'updates' the results by...
2
2391
by: Ray Holtz | last post by:
I have a form that shows a single record based on a query criteria. When I click a button it is set to use an append query to copy that record to a separate table, then deletes the record from the first table. Both tables have a 'DateTime' field that shows when it was last updated using the Now function. What I am trying to do is get the 'DateTime' field updated after the append query copies it to the new table. I have tried updating...
3
5002
by: MLH | last post by:
I have a form, bound to a query. Its RecordSource property is a query named frmEnterLienAmounts. The form has a few bound controls and some unbound controls. The unbound controls are calculated fields whose DefaultValue property is set to something like DLookUp("","tblVehicleJobs","=Forms!frmEnterLienAmounts!VehicleJobID") The form (frmEnterLienAmounts) has, as one of its bound fields . As I scroll through the records, one-
5
2026
by: junglist | last post by:
Hi guys, I've been trying to implement an editable datagrid and i have been succesful up to the point where i can update my datagrid row by row. However what used to happen was that once i updated one row, all of them were updated so i immediatelly figured out that i have to include the id of every entry in the update statement. This is where the problem is raised. My database is an Access database. The table i am updating contains a Date...
4
2410
by: Winshent | last post by:
I am having problems with adding items to my shopping cart. The problem occures when adding items that already exists in the cart. When a user adds to cart, they are automatically redirected to the cart, where they can update quantities. If the item already exists in the cart, i want to update the quantity by adding 1 to the quantity of that item. The code all works fine when i step thru the code, however when running it without...
5
3740
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 information: Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype. It occurs when I attempt to add a new record. I've stripped out much of the code, leaving the pertinent (I hope) info. ...
33
3312
by: bill | last post by:
In an application I am writing the user can define a series of steps to be followed. I save them in a sql database using the field "order" (a smallint) as the primary key. (there are in the range of 20 steps) On the admin page the steps are listed, in "order" order and the user can create new steps and assign an order and all is well. The problem may come in using a renumber function which should take the steps in their current order...
4
3477
by: aaronyoung | last post by:
I have created custom navigation buttons and Record Number indicators on several forms that are used to review and update records based on a query. My On Current event to update the "Record X of Y" is Private Sub Form_Current() Dim frm As Form, LastRec As Long Set frm = Forms!ReviewSearchRecordsForm
0
8343
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
8762
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
8545
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
7365
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...
1
6185
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5653
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
4179
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...
0
4347
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1747
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.