473,403 Members | 2,323 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,403 software developers and data experts.

Error in Updateing my table

I am trying to update my tables, and this error occurs
Runtime error '-2147217900 (80040e14)':syntax error in update statement only for the table Action types.This is the code
and where error occurs is in Bold
Expand|Select|Wrap|Line Numbers
  1. If frmAdd.Caption = " CITY " Then
  2.         StrSql = "UPDATE City SET CITY = '" & Text1.Text & "' WHERE CITY _
  3.          = '" & OldVal & "'"
  4.         CnEdit.Execute StrSql
  5. ElseIf frmAdd.Caption = " TYPE OF ACTION " Then
  6.         StrSql = "UPDATE ActionTypes SET Action = '" & Text1.Text & "' _
  7.         WHERE Action = '" & OldVal & "'"
  8.         CnEdit.Execute StrSql
  9. ElseIf frmAdd.Caption = " RNE NAME " Then
  10.         StrSql = "UPDATE RNE_names SET RNEName = '" & Text1.Text & "' _
  11.         WHERE RNEName = '" & OldVal & "'"
  12.         CnEdit.Execute StrSql
  13.     End If
  14.  
please not that all parameters have been set and the error doesnt occur when the caption is City or RNE Names.
Thank you.
Feb 1 '07 #1
7 1289
willakawill
1,646 1GB
Hi. If you have pasted your code here the answer is easy enough.
Expand|Select|Wrap|Line Numbers
  1. StrSql = "UPDATE ActionTypes SET Action = '" & Text1.Text & "' _
  2.         WHERE Action = '" & OldVal & "'"
is missing quote marks
Expand|Select|Wrap|Line Numbers
  1. StrSql = "UPDATE ActionTypes SET Action = '" & Text1.Text & "'" _
  2.         & " WHERE Action = '" & OldVal & "'"
This is on all 3 of your sql statements
Feb 1 '07 #2
Killer42
8,435 Expert 8TB
Hi. If you have pasted your code here the answer is easy enough.
Expand|Select|Wrap|Line Numbers
  1. StrSql = "UPDATE ActionTypes SET Action = '" & Text1.Text & "' _
  2.         WHERE Action = '" & OldVal & "'"
is missing quote marks ...
But how would that have made it past syntax check?
Feb 2 '07 #3
willakawill
1,646 1GB
But how would that have made it past syntax check?
We have to start somewhere. How could we get any further than obvious typos if we don't get them straight first?
Feb 2 '07 #4
Killer42
8,435 Expert 8TB
We have to start somewhere. How could we get any further than obvious typos if we don't get them straight first?
Excellent point. Just wondered whether I've missed some "continue with errors" option or something.
Feb 2 '07 #5
Killer42
8,435 Expert 8TB
I've got it! Bet you $5 that Action is numeric. :)
Feb 2 '07 #6
RESOLVED
Thanks for all your help. I discovered Action as a reserved word in VB, changed the column name and now it works.
Feb 4 '07 #7
Killer42
8,435 Expert 8TB
RESOLVED
Thanks for all your help. I discovered Action as a reserved word in VB, changed the column name and now it works.
Rats! There goes my 5 bucks.

Glad to hear you've resolved the problem, though. :D
Feb 4 '07 #8

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

Similar topics

0
by: Morten Gulbrandsen | last post by:
C:\mysql\bin>mysql -u elmasri -pnavathe company Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 29 to server version: 4.1.0-alpha-max-debug Type...
0
by: Morten Gulbrandsen | last post by:
mysql> USE company; Database changed mysql> mysql> DROP TABLE IF EXISTS EMPLOYEE; -------------- DROP TABLE IF EXISTS EMPLOYEE -------------- Query OK, 0 rows affected (0.00 sec)
17
by: Steve Jorgensen | last post by:
If you've ever employed custom error numbers and messages in you programs, you've probably ended up with code similar to what I've ended up with in the past something like... <code> public...
7
by: Jake | last post by:
Hi all, I am trying to update an SQL server table from a dataset populated by an excel spread sheet. Each record has a check box so it can be excluded from the SQL server table population. ...
3
by: Newbie! | last post by:
Hi Group, How would one Update, Delete and Add a Table in VB.Net using a Access Database? Any Links would be appriciated Ta Si
1
by: Kumarswamy | last post by:
hi, While updateing a column in a table,using rowid as references i am getting error like "ORA-00603: ORACLE server session terminated by fatal". Please can anyone tell me reason for this. ...
1
by: Trevor2007 | last post by:
Update query should update the date field in a table but does not, I try printing off with debug.print and no results DoCmd.RunSQL "UPDATE IndividualSettingsTbl SET IndividualSettingsTbl.Date =...
10
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration...
3
praclarush
by: praclarush | last post by:
I'm trying to Update one table with info from another table this is the query that I'm using UPDATE Formula INNER JOIN TempFormulas ON Formula.FormulaID = TempFormulas.FormulaID SET...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...

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.