- db.Execute "INSERT INTO TAXDET (ECODE, totsaving,OTHERSAV) VALUES('" & ecode & "'," & totsaving & "," & OTHERSAV & ")"
gives error
syntax error in sql statement
and in debug mode it shows totsaving =null and
OTHERSAV =null
kindly help me to correct error
thanx in adv
On my way out the door to work, thus, only a very quick look and answer:
You really haven't provided enough of the code to help.
What I do is build the string first so that you can troubleshoot the resolved string. Something along the lines of: - strSQL = "INSERT INTO TAXDET (ECODE, totsaving,OTHERSAV) VALUES('" & ecode & "'," & totsaving & "," & OTHERSAV & ")"
-
Debug.Print strSQL
-
db.Execute strSQL
Now you can look in the debug window and see what your string issue is...
2 1190 zmbd 5,501
Expert Mod 4TB
On my way out the door to work, thus, only a very quick look and answer:
You really haven't provided enough of the code to help.
What I do is build the string first so that you can troubleshoot the resolved string. Something along the lines of: - strSQL = "INSERT INTO TAXDET (ECODE, totsaving,OTHERSAV) VALUES('" & ecode & "'," & totsaving & "," & OTHERSAV & ")"
-
Debug.Print strSQL
-
db.Execute strSQL
Now you can look in the debug window and see what your string issue is...
NeoPa 32,556
Expert Mod 16PB
Your string issue is that you have no values for either of these fields in your SQL command. If you want Null then you have to use the text "Null", and if you want zero then "0". Leaving it empty, as you have done, will throw an error (such as you've seen).
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Robert Mark Bram |
last post by:
Hi All!
I have the following two methods in an asp/jscript page - my problem is that
without the update statement there is no error, but with the update
statement I get the following error:
...
|
by: shank |
last post by:
1) I'm getting this error: Syntax error (missing operator) in query
expression on the below statement. Can I get some advice.
2) I searched ASPFAQ and came up blank. Where can find the "rules"...
|
by: kosta |
last post by:
hello! one of my forms communicates with a database, and is
supposed to add a row to a table using an Insert
statement... however, I get a 'oledb - syntax error'
exception... I have double...
|
by: Nathan Sokalski |
last post by:
When trying to submit data to an Access database using ASP.NET I recieve the
following error:
System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32 hr)
+41...
|
by: amitbadgi |
last post by:
HI i am getting the foll error while conv an asp application to
asp.net
Exception Details: System.Runtime.InteropServices.COMException: Syntax
error in UPDATE statement.
Source Error:
Line...
|
by: amitbadgi |
last post by:
Hi guys, I am getting the following error in teh insert statement , I
am converting this asp application to asp.net, here is teh error,
Exception Details:...
|
by: Nate |
last post by:
I am trying to use the following IF statement, and whenever I use a
single or double quote, I receive a syntax error. When using no
quotes, the syntax is accepted, but the statement does not...
|
by: Alexis Boutillier |
last post by:
Timothy Grant a écrit :
As you can see in my last response, this problem is not linked to the
type of error, If I "raise" a SystemError instead of creating a
SyntaxError I still can't access...
|
by: vasanth chandrasekaran |
last post by:
The error is :Syntax error in INSERT INTO statement.
This is my code:
try
{
DataSet ds1;
OleDbConnection ConnSql;
OleDbConnection...
|
by: lingjun |
last post by:
Hi,
I am taking my first programing course in college... and I am completely lost on this assignment. I am not sure what is wrong with my current code. Any help will be appreciate it... thanks!
...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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...
|
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,...
| |