473,591 Members | 2,899 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

syntax errpr near parenthesis

syedshaffee
91 New Member
this is my code
Expand|Select|Wrap|Line Numbers
  1. dim i
  2. dim checkboxValue
  3. dim TextBoxValue
  4.  
  5. dim Count
  6. dim Count1
  7. dim postion
  8. dim postion1
  9. position=0
  10. postion1=0
  11. i=0
  12. Checkbox1= Request.Form("same")
  13. strdate=Request.Form("Date")
  14. a=Split(strdate ,",")
  15. b=Split(Checkbox1,",") 
  16. if strdate<>"" and Checkbox1<>"" then
  17. TextBoxValue=UBound(a)
  18. checkboxValue=UBound(b)
  19. 'Response.Write(TextBoxValue)
  20. if TextBoxValue  > checkboxValue then
  21. for i=0 to TextBoxValue
  22. Set objRIMSConn1 = Server.CreateObject("ADODB.Connection")
  23.     objRIMSConn1.Open RIMS_CONNECT
  24.     objRIMSConn1.Execute "Insert into Eot_returned(Asset_id,Date) values("+b(i)+",'"+a(i)+"');"
  25. next
  26. objRIMSConn1.Close
  27.     Set objRIMSConn1 = nothin
  28.     else
  29.     for i=0 to checkboxValue
  30. Set objRIMSConn1 = Server.CreateObject("ADODB.Connection")
  31.     objRIMSConn1.Open RIMS_CONNECT
  32.     objRIMSConn1.Execute "Insert into Eot_returned(Asset_id,Date) values(" +b(i)+ "," +a(i)+ ")"
  33. next
  34. end if
  35.  
  36.     Response.Write("<script language='javascript' type='text/javascript'> alert('The value hass been Inserted'); </script>")
  37.      else
  38.     Response.Write("<script language='javascript' type='text/javascript'> alert('Do you want to return any asset'); </script>")
  39. end if
Erro:Near ")" please an u people help me???????????
Attached Files
File Type: txt Code.txt (1.1 KB, 387 views)
Jan 26 '12 #1
18 2192
Rabbit
12,516 Recognized Expert Moderator MVP
You've only defined one field to insert into but you include two values.
Jan 26 '12 #2
syedshaffee
91 New Member
yes i can but the problem is in two its giving an error
Jan 26 '12 #3
Rabbit
12,516 Recognized Expert Moderator MVP
I have no idea what you're saying. I'm saying that you can't specify two values when you only specify one column.
Jan 26 '12 #4
multinett
16 New Member
you have no space between ")" and "values"
if you want any help, it's better to post the full error message.
you can get the error message with
response.write err.description
Jan 26 '12 #5
syedshaffee
91 New Member
thnaks u guys and mlutinett i will post the full error message
Jan 26 '12 #6
jhardman
3,406 Recognized Expert Specialist
Rabbit is definitely right: the insert statement has the wrong number of fields.
If you were inserting into just one field the command would look like this:
Expand|Select|Wrap|Line Numbers
  1. insert into eot_returned (asset_id) values (4)
but if you were inserting into two different fields, the command would look like this:
Expand|Select|Wrap|Line Numbers
  1. insert into eot_returned (asset_id, asset_name) values (4, 'John')
If you were trying to insert into one field but two different records, you would need two different insert statements
Expand|Select|Wrap|Line Numbers
  1. insert into eot_returned (asset_id) values (4);
  2. insert into eot_returned (asset_id) values (5)
the way you have it is definitely wrong, but I can't tell which you are trying to do.

Jared
Jan 26 '12 #7
syedshaffee
91 New Member
jhardman i have changed the code and still it is giving me an error the following is the error:

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near ')'.
, line 876
Jan 27 '12 #8
syedshaffee
91 New Member
OKAY now the values are going to the database but its still displaying the same page
Jan 27 '12 #9
Rabbit
12,516 Recognized Expert Moderator MVP
What do you mean it displays the same page?
Jan 27 '12 #10

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

Similar topics

0
2850
by: Trevor Sather | last post by:
------=_NextPart_000_004D_01C3456C.66EFEC50 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hello The following query used to work when I was using an Access database, but now that I've moved to MySQL I get a syntax error when I try and run it:
19
2952
by: Nicolas Fleury | last post by:
Hi everyone, I would to know what do you think of this PEP. Any comment welcomed (even about English mistakes). PEP: XXX Title: Specialization Syntax Version: $Revision: 1.10 $ Last-Modified: $Date: 2003/09/22 04:51:49 $ Author: Nicolas Fleury <nidoizo at gmail.com> Status: Draft Type: Standards Track
5
4491
by: r.nikhilk | last post by:
Hi, Currently, we are porting C++ applications from 32 bit to 64 bit on AIX platform. (The current version of AIX is 5.3 and xlC verison is 8.0). We are able to compile the applications by including the -q64 option in xlC compiler. And we are able to link all these libraries to one of the main applications and generate an executable. SKLoader. But, when we try to run this main executable, we are getting the following errors:
1
2678
by: obastard | last post by:
Hi Having a problem with a ms sql 2000 server. The script below was created i SQL manager 2005 lite and gives a syntax error near '(' ALTER TABLE . ADD CONSTRAINT PRIMARY KEY CLUSTERED () WITH ( PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF,
2
10820
by: ielmrani via SQLMonster.com | last post by:
Hi Everyone, I really tried to not post this question but I gave up. I tried brackets, parenth...etc but nothing worked. I get this error message: Incorrect syntax near the keyword 'THEN'. Please help, I am learning SQL Server. thanks in advance. Ismail use mis select CLAIM_DETAILS_HCVW.INTEREST, CLAIM_DETAILS_HCVW.NET, CLAIM_HMASTERS_VS.
1
2274
by: gatorfalcon | last post by:
I'm using mysqli_multi_query to run multiple queries concatenated with a semicolon that I set using the HEREDOC format. What's weird is that this works fine on my development system on my laptop (a PC running PHP 5.x and mysql5.x). When I bring the code onto a linux system (with my ISP), the code chokes with a syntax error near the first semicolon. I believe they too are running PHP 5.x and mysql 5.x. Any clues what's going on? I mean,...
2
3500
by: Shrutisinha | last post by:
I am getting this error in unix .. syntax error near unexpected token `(' when i am running my parser , can anybody help me plzz .. i am new to all this thanks
3
2318
by: silambu | last post by:
hi,can anybody tell reason for getting syntax error near , while either updating or inserting records in table
4
6817
by: bhunesh | last post by:
hey , i m getting error listed below plz help me /virtualHosts/beta.myiris.com/htdocs/commodities/commd_admin/CRONJOB/new_cronjob/new_mcx.pl: line 14: syntax error near unexpected token `"/usr/bin/wget -O /tmp/mcx.dat http://www.mcxindia.com/xmlurl/GetTouchLine.aspx?userid=IRIS&pwd=CZ33M3KZ53"' #!/usr/bin/perl #Purpose : To create MCX DAT file from mcx feed coming from mcxindia.com #Author : Yatin Patil
4
3222
by: cluce | last post by:
I am getting a syntax error but I cant seem to spot it. need help with this. Its when I click the save button that fires my SQL UPDATE query. thansk in advance 'module level declarations Dim rsNames As ADODB.Recordset Dim cnDb As ADODB.Connection Dim strConnection As String Dim blnAddMode As Boolean
0
7871
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8236
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8366
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8227
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6642
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5735
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3851
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3893
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2379
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.