Access Table Update

Dave_e

Member
Joined
Mar 15, 2008
Messages
6
Programming Experience
Beginner
Hi,

Can someone please point me in the right direction for updating a single field within a table in Access.

I've been searching and trying numerous examples but I'm having no luck.

I believe my UPDATE command is correct

VB.NET:
Expand Collapse Copy
UPDATE Table1 SET Field1 ='Test' where id='1'

Here's what I currently have so far in full....

VB.NET:
Expand Collapse Copy
        Dim cn As OleDbConnection
        Dim cmd As OleDbCommand

        cn = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\User1\Desktop\Database3.accdb;Persist Security Info=False;")
        cn.Open()

        cmd = New OleDbCommand("UPDATE Table1 SET Field1 ='Test' where id='1'", cn)
        cmd.ExecuteNonQuery()

        cn.Close()

I'm getting a Data type mismatch in criteria expression at the cmd.ExecuteNonQuery()

Any help would be much appreciated.


Many thanks
 
MattP,

Thank you, thank you and thank you!

I've spent a lot of time trying to get this to work and now I'm really please .....

Thanks again.

D
 
Back
Top