467,894 Members | 1,447 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,894 developers. It's quick & easy.

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
  • viewed: 853
Share:
4 Replies
"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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Jason | last post: by
1 post views Thread by Chris Jackson | last post: by
2 posts views Thread by Ray Holtz | last post: by
5 posts views Thread by junglist | last post: by
4 posts views Thread by Winshent | last post: by
33 posts views Thread by bill | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.