473,382 Members | 1,750 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,382 software developers and data experts.

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 programmatically 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......Please?

MooVBuff
Jun 27 '08 #1
4 973
"MooVBuff" <ed*****@comcast.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 programmatically 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......Please?
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("<connectionstring>")
Dim cmd As New OleDbCommand("update table set f1=? where id=?",
con)

con.Open()

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

cmd.ExecuteNonQuery()

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 programmatically 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......Please?

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......Please?
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**********@discussions.microsoft.comwrote in message
news:03**********************************@microsof t.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 programmatically 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......Please?

MooVBuff

Jun 27 '08 #5

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

Similar topics

11
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
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...
2
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...
3
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...
5
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...
4
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...
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...
33
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...
4
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.