473,700 Members | 2,380 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 1635
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
5473
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
4459
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
3115
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
6627
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
16510
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
3388
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
4748
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
6654
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
5998
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
8726
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
8645
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
9075
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...
1
8973
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8925
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...
1
6561
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
5903
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();...
2
2392
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2028
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.