472,340 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Updating a Access database

Hey guys,



I have tryed something new code with updating an access database but the error

Syntax error in UPDATE statement occurs every time i try to update. Can some please help me figure out why this problem is happening. Here is the code



Public Class Form1


[code]
Dim con As New OleDb.OleDbConnection("Provider = Microsoft.Jet.OleDB.4.0;Data Source = E:\WindowsApplication1\WindowsApplication1\bin\Deb ug\rl.mdb;")



Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click



updatedata()



End Sub



Public Function updatedata()



Dim str1 As String = "UPDATE playersnames SET Player Name = '" & TextBox1.Text & "' AND Meters = '" & TextBox2.Text & "'"

Dim cmd As New OleDb.OleDbCommand(str1, con)

con.Open()

cmd.ExecuteNonQuery()

cmd.Cancel()

con.Close()

intialization()

intialization2()



End Function



Public Function intialization()



Dim adp As New OleDb.OleDbDataAdapter("select * from playermeters", con)

Dim dt As DataTable

Dim ds As New DataSet

adp.Fill(ds)

dt = ds.Tables(0)



End Function



Public Function intialization2()



Dim adp As New OleDb.OleDbDataAdapter("select * from playersmeters", con)

Dim dr As DataRow

Dim dt As DataTable

Dim ds As New DataSet

adp.Fill(ds)

dt = ds.Tables(0)



End Function

[code]
Jun 29 '07 #1
1 1127
kenobewan
4,871 Expert 4TB
Suggest you write the update statement and see if there is a problem.
Jun 30 '07 #2

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

Similar topics

2
by: Fran Tirimo | last post by:
I am developing a small website using ASP scripts to format data retrieved from an Access database. It will run on a Windows 2003 server supporting...
2
by: RC | last post by:
I am updating/improving a working database for a non-profit organization. I am thinking of making a copy of the database at the office, bringing...
1
by: gaosul | last post by:
I am non-programming scientist and I am using a Program called Easyarticles from Synaptosoft Inc., which is based the database program Access....
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....
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...
2
by: Alexey.Murin | last post by:
The application we are developing uses MS Access 2003 database (with help of ADO). We have noticed that during massive records updating the size of...
14
by: John T Ingato | last post by:
I have a contacts table with name address and such but are missing all phone numbers in the phone number fields. I have just received an updated...
5
by: aaron.m.johnson | last post by:
I have an application which contains an Access database with linked tables that point to another database within the application. The problem I...
11
by: bbasberg | last post by:
Hello, I have been struggling with this problem for DAYS and have googled my heart out as well as reading any books I could get my hands on but I...
1
by: Wavey | last post by:
Hi All, I have a problem with updating an Access database from a datatable. I have two rows of data in my database at the moment for testing, the...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...

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.