473,657 Members | 2,418 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cannot Find Error on this ASP

M P
Hi Team!

Hope that you could help me! Its been days since I made this script but I
cannot fix the problem! IE is prompting me that there is a Syntax Error but
it seems that the syntax is OK! Can you help me find the problem?

Note the fields PartNo and ItemDesc is the only text data type on my MS
Access database.
<%
Dim strSQL

Set conn= Server.CreateOb ject("ADODB.Con nection")
conn.Open "FileDSN=dsn.ds n"
strSQL= "INSERT INTO tblItems
(PartNo,ItemDes c,Category,MinS tockLevel,Cost, Currency) "
strSQL= strSQL & "Values('" & Request.Form("t xtPN") & "', '"
strSQL= strSQL & Request.Form("t xtItemDesc") & "', "
strSQL= strSQL & Request.Form("t xtCategory") & ", "
strSQL= strSQL & Request.Form("t xtMinStock") & ", "
strSQL= strSQL & Request.Form("t xtCost") & ", "
strSQL= strSQL & Request.Form("t xtCurrency") & ")"

conn.Execute strSQL

conn.Close

%>
Jul 19 '05 #1
5 1633
I could be wrong but, the error appears to be with the following 2 lines;

<second line>
strSQL= strSQL & "Values('" & Request.Form("t xtPN") & "', '"

<last line>
strSQL= strSQL & Request.Form("t xtCurrency") & ")"

You've got a ' after Values( and at the end with the comma, but there's no
matching one at the end of the last line (closing the ")" )

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
M P <ma**@textguru. ph> wrote in message
news:uQ******** ******@TK2MSFTN GP12.phx.gbl...
Hi Team!

Hope that you could help me! Its been days since I made this script but I
cannot fix the problem! IE is prompting me that there is a Syntax Error but it seems that the syntax is OK! Can you help me find the problem?

Note the fields PartNo and ItemDesc is the only text data type on my MS
Access database.
<%
Dim strSQL

Set conn= Server.CreateOb ject("ADODB.Con nection")
conn.Open "FileDSN=dsn.ds n"
strSQL= "INSERT INTO tblItems
(PartNo,ItemDes c,Category,MinS tockLevel,Cost, Currency) "
strSQL= strSQL & "Values('" & Request.Form("t xtPN") & "', '"
strSQL= strSQL & Request.Form("t xtItemDesc") & "', "
strSQL= strSQL & Request.Form("t xtCategory") & ", "
strSQL= strSQL & Request.Form("t xtMinStock") & ", "
strSQL= strSQL & Request.Form("t xtCost") & ", "
strSQL= strSQL & Request.Form("t xtCurrency") & ")"

conn.Execute strSQL

conn.Close

%>

Jul 19 '05 #2
Before:
conn.Execute strSQL

Do this:

<%
Response.Write( strSQL)
Response.End

conn.Execute strSQL
%>

and you will see your SQL statement printed to the screen. Examine it for
errors, or post it here.

Cheers
Ken
"M P" <ma**@textguru. ph> wrote in message
news:uQ******** ******@TK2MSFTN GP12.phx.gbl...
: Hi Team!
:
: Hope that you could help me! Its been days since I made this script but I
: cannot fix the problem! IE is prompting me that there is a Syntax Error
but
: it seems that the syntax is OK! Can you help me find the problem?
:
: Note the fields PartNo and ItemDesc is the only text data type on my MS
: Access database.
:
:
: <%
: Dim strSQL
:
: Set conn= Server.CreateOb ject("ADODB.Con nection")
: conn.Open "FileDSN=dsn.ds n"
: strSQL= "INSERT INTO tblItems
: (PartNo,ItemDes c,Category,MinS tockLevel,Cost, Currency) "
: strSQL= strSQL & "Values('" & Request.Form("t xtPN") & "', '"
: strSQL= strSQL & Request.Form("t xtItemDesc") & "', "
: strSQL= strSQL & Request.Form("t xtCategory") & ", "
: strSQL= strSQL & Request.Form("t xtMinStock") & ", "
: strSQL= strSQL & Request.Form("t xtCost") & ", "
: strSQL= strSQL & Request.Form("t xtCurrency") & ")"
:
: conn.Execute strSQL
:
: conn.Close
:
: %>
:
:
Jul 19 '05 #3
Hi M

Assuming you've copied and pasted this text, then the issue will be with your SQL string (starting with "strSQL ="). On this line you've missed the ending " & _, so it should look like this

strSQL= "INSERT INTO tblItems" &

and on each line of the string thereafter you have the trailing ", but not the required & _. This is how it should be

Set conn= Server.CreateOb ject("ADODB.Con nection"
conn.Open "FileDSN=dsn.ds n
strSQL= "INSERT INTO tblItems" &
(PartNo,ItemDes c,Category,MinS tockLevel,Cost, Currency) " &
strSQL= strSQL & "Values('" & Request.Form("t xtPN") & "', '" &
strSQL= strSQL & Request.Form("t xtItemDesc") & "', " &
strSQL= strSQL & Request.Form("t xtCategory") & ", " &
strSQL= strSQL & Request.Form("t xtMinStock") & ", " &
strSQL= strSQL & Request.Form("t xtCost") & ", " &
strSQL= strSQL & Request.Form("t xtCurrency") & ")

In any command or string in VBScript, if you want to break a single line statement up from one line into multiple, you need to add a underscore (_) to the end of the line. This is the character VBScript uses to indicate the next line is a continuum of the current line

Cheer
Lai

Jul 19 '05 #4
jon
Ensure that the non-text values do actually contain a numeric value, otherwise you will be posting back a blank - which will cause an error. Try adding a check function to ensure this i.e.

Function ConvNo(pNo)

If IsNumeric(pNo) Then
ConvNo = Cdbl(pNo)
Else
ConvNo = 0
End if

End Function

Then call this on each of the numeric field as:

ConvNo(Request. Form("txtCurren cy"))

This will ensure that 0 is passed rather than "" on an expected numeric entry.

*************** *************** *************** *************** **********
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
Jul 19 '05 #5

"Lain" <an*******@disc ussions.microso ft.com> wrote in message
news:C9******** *************** ***********@mic rosoft.com...
Hi M P

Assuming you've copied and pasted this text, then the issue will be with your SQL string (starting with "strSQL ="). On this line you've missed the
ending " & _, so it should look like this:
strSQL= "INSERT INTO tblItems" & _

and on each line of the string thereafter you have the trailing ", but not the required & _. This is how it should be:
Set conn= Server.CreateOb ject("ADODB.Con nection")
conn.Open "FileDSN=dsn.ds n"
strSQL= "INSERT INTO tblItems" & _
(PartNo,ItemDes c,Category,MinS tockLevel,Cost, Currency) " & _
strSQL= strSQL & "Values('" & Request.Form("t xtPN") & "', '" & _
strSQL= strSQL & Request.Form("t xtItemDesc") & "', " & _
strSQL= strSQL & Request.Form("t xtCategory") & ", " & _
strSQL= strSQL & Request.Form("t xtMinStock") & ", " & _
strSQL= strSQL & Request.Form("t xtCost") & ", " & _
strSQL= strSQL & Request.Form("t xtCurrency") & ")"
In any command or string in VBScript, if you want to break a single line statement up from one line into multiple, you need to add a underscore (_)
to the end of the line. This is the character VBScript uses to indicate the
next line is a continuum of the current line.
Cheers
Lain


True enough but he's not breaking the line up !!

so he doesn't need the &_

Jul 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
5463
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- Hello, I have a very simple problem but cannot seem to figure it out. I have a very simple php script that sends a test email to myself. When I debug it in PHP designer, it works with no problems, I get the test email. If
10
4449
by: Jean-David Beyer | last post by:
I have some programs running on Red Hat Linux 7.3 working with IBM DB2 V6.1 (with all the FixPacks) on my old machine. I have just installed IBM DB2 V8.1 on this (new) machine running Red Hat Enterplise Linux 3 ES, and applied FixPack fp5_mi00069.tar to it. After creating an instance, starting the database, creating a database, and entering the table definitions, all of which seems to work OK, I entered a tiny 8-row table and can do...
0
3102
by: SampathTangudu | last post by:
Hi, We are trying to use the Hash Tables for passing information from one aspx page to another aspx page. We are using the below code. IsolatedStorageFile isoStore = IsolatedStorageFile.GetStore( IsolatedStorageScope.User | IsolatedStorageScope.Assembly |IsolatedStorageScope.Domain , null, null );
1
6616
by: Peter | last post by:
I've purchased VS.NET 2005 Standard and have tried to install SQL Server 2005 Express, but get the following error in the error log. Please could someone help me.... Microsoft SQL Server 2005 Express Edition x86: Component Microsoft SQL Server 2005 Express Edition x86 returned an unexpected value. ***EndOfSession***? Microsoft SQL Server 2005 Express Edition x86: Component Microsoft SQL Server 2005 Express Edition x86 returned an...
3
16506
by: David T. Ashley | last post by:
Hi, Red Hat Enterprise Linux 4.X. I'm writing command-line PHP scripts for the first time. I get the messages below. What do they mean? Are these operating system library modules, or something in PHP that I don't have? Do I need to install more Linux packages? Or adjust PHP in some way?
0
3386
by: Curious | last post by:
Hi, I'm not sure if this is the right place to post such command issues. If you know a better forum where people respond to messages fairly often, please let me know! Anyway, would appreciate your help! --------------------------------------------------------------------------------------------------------------- Hi, I've created a scheduler job with FORFILES command to delete files
4
4740
by: GHUM | last post by:
The compile works, BUT linking fails: 2.5\Release\psycopg\_psycopg.def -Lc:\python25\libs -Lc: \python25\PCBuild -Lc:/p ostgres/83RC2/lib -lpython25 -lpq -lws2_32 -ladvapi32 -o build \lib.win32-2.5\psy copg2\_psycopg.pyd c:\mingw\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: cannot find -lpq collect2: ld returned 1 exit status
2
6650
by: karinmorena | last post by:
I'm having 4 errors, I'm very new at this and I would appreciate your input. The error I get is: Week5MortgageGUI.java:151:cannot find symbol symbol: method allInterest(double,double,double) Location: class Week5MortgageGUI Week5MortgageLogic allint = logic.allInterest(amount, term, rate); Week5MortgageGUI.java:152:cannot find symbol symbol: method allInterest(double,double,double) Location: class Week5MortgageGUI
0
2874
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgRGVzYXJyb2xsbw==?= | last post by:
Hi all, my problem is about services. I try comment you all steps for my issue: My development environment: Windows XP SP2
0
5996
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgRGVzYXJyb2xsbw==?= | last post by:
Hi all, my problem is about services. I try comment you all steps for my issue: My development environment: Windows XP SP2
0
8402
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8829
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
8608
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
7341
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
6172
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
5633
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4323
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2733
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
2
1962
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.