473,700 Members | 2,845 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

whats wrong with this SQL string

Hi all,
I ahve the following SQL string but when i try to response.Write it there is
a error where the ',' should be between "city" and "County"

SQL = "INSERT * INTO customers (Company_Name, Category, Contact_Name,
Contact_Title, Address_1, Address_2, City, County, Post_Code, Phone_1,
Phone_2, Fax, Web_URL, email_Address, Delivery, Notes)"
SQL = SQL & " VALUES('" & Request.Form("C ompany_Name") & "','" &
Request.Form("C ategory") & "','" * Request.Form("C ontact_Name") & "','" &
Request.Form("C ontact_Title") & "','" * Request.Form("A ddress_1") & "','" &
Request.Form("A ddress_2") & "','" & Request.Form("C ity") & "','" &
Request.Form("C ounty") & "','" & Request.Form("P ost_Code") & "','" &
Request.Form("P hone_2") & "','" & Request.Form("F ax") & "','" &
Request.Form("W eb_Url") & "','" & Request.Form("e mail_address") & "','" &
Request.Form("D elivery") & "','" & Request.Form("N otes") & "')"

OUTPUT

INSERT * INTO customers (Company_Name, Category, Contact_Name,
Contact_Title, Address_1, Address_2, City, County, Post_Code, Phone_1,
Phone_2, Fax, Web_URL, email_Address, Delivery, Notes)
VALUES('','1',' ','','','addres s_2','1, 1','','','','', '','','','')

The text in questiuon is '1,1' When it should be '1','1' The SQL code should
output that syntax but it isnt? Any ideas why?


Jul 19 '05 #1
5 2089
Do a Response.Write on JUST the two vaules in question once.
--
----------------------------------------------------------
Curt Christianson (Software_AT_Da rkfalz.Com)
Owner/Lead Designer, DF-Software
http://www.Darkfalz.com
---------------------------------------------------------
...Offering free scripts & code snippits for everyone...
---------------------------------------------------------
"Mike M" <mi**@mack1.kar oo.co.uk> wrote in message
news:bh******** **@newsreaderm1 .core.theplanet .net...
Hi all,
I ahve the following SQL string but when i try to response.Write it there is a error where the ',' should be between "city" and "County"

SQL = "INSERT * INTO customers (Company_Name, Category, Contact_Name,
Contact_Title, Address_1, Address_2, City, County, Post_Code, Phone_1,
Phone_2, Fax, Web_URL, email_Address, Delivery, Notes)"
SQL = SQL & " VALUES('" & Request.Form("C ompany_Name") & "','" &
Request.Form("C ategory") & "','" * Request.Form("C ontact_Name") & "','" &
Request.Form("C ontact_Title") & "','" * Request.Form("A ddress_1") & "','" & Request.Form("A ddress_2") & "','" & Request.Form("C ity") & "','" &
Request.Form("C ounty") & "','" & Request.Form("P ost_Code") & "','" &
Request.Form("P hone_2") & "','" & Request.Form("F ax") & "','" &
Request.Form("W eb_Url") & "','" & Request.Form("e mail_address") & "','" &
Request.Form("D elivery") & "','" & Request.Form("N otes") & "')"

OUTPUT

INSERT * INTO customers (Company_Name, Category, Contact_Name,
Contact_Title, Address_1, Address_2, City, County, Post_Code, Phone_1,
Phone_2, Fax, Web_URL, email_Address, Delivery, Notes)
VALUES('','1',' ','','','addres s_2','1, 1','','','','', '','','','')

The text in questiuon is '1,1' When it should be '1','1' The SQL code should output that syntax but it isnt? Any ideas why?

Jul 19 '05 #2
You probably have 2 city form fields causing the 1,1 indexed value.

Cheers!

Shawn Jackson
Freelance Web Developer
http://www.actionjackson.com
http://www.developersdex.com
http://www.automationtools.com
sh***@actionjac kson.com
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #3
grw
Whats the " * Request.Form" all about?

I think youll find its because of that typo.
The & is next door ;-)
"Mike M" <mi**@mack1.kar oo.co.uk> wrote in message
news:bh******** **@newsreaderm1 .core.theplanet .net...
Hi all,
I ahve the following SQL string but when i try to response.Write it there is a error where the ',' should be between "city" and "County"

SQL = "INSERT * INTO customers (Company_Name, Category, Contact_Name,
Contact_Title, Address_1, Address_2, City, County, Post_Code, Phone_1,
Phone_2, Fax, Web_URL, email_Address, Delivery, Notes)"
SQL = SQL & " VALUES('" & Request.Form("C ompany_Name") & "','" &
Request.Form("C ategory") & "','" * Request.Form("C ontact_Name") & "','" &
Request.Form("C ontact_Title") & "','" * Request.Form("A ddress_1") & "','" & Request.Form("A ddress_2") & "','" & Request.Form("C ity") & "','" &
Request.Form("C ounty") & "','" & Request.Form("P ost_Code") & "','" &
Request.Form("P hone_2") & "','" & Request.Form("F ax") & "','" &
Request.Form("W eb_Url") & "','" & Request.Form("e mail_address") & "','" &
Request.Form("D elivery") & "','" & Request.Form("N otes") & "')"

OUTPUT

INSERT * INTO customers (Company_Name, Category, Contact_Name,
Contact_Title, Address_1, Address_2, City, County, Post_Code, Phone_1,
Phone_2, Fax, Web_URL, email_Address, Delivery, Notes)
VALUES('','1',' ','','','addres s_2','1, 1','','','','', '','','','')

The text in questiuon is '1,1' When it should be '1','1' The SQL code should output that syntax but it isnt? Any ideas why?

Jul 19 '05 #4

"Mike M" <mi**@mack1.kar oo.co.uk> wrote in message
news:bh******** **@newsreaderm1 .core.theplanet .net...
Hi all,
I ahve the following SQL string but when i try to response.Write it there is a error where the ',' should be between "city" and "County"

SQL = "INSERT * INTO customers (Company_Name, Category, Contact_Name,
Contact_Title, Address_1, Address_2, City, County, Post_Code, Phone_1,
Phone_2, Fax, Web_URL, email_Address, Delivery, Notes)"
SQL = SQL & " VALUES('" & Request.Form("C ompany_Name") & "','" &
Request.Form("C ategory") & "','" * Request.Form("C ontact_Name") & "','" &
Request.Form("C ontact_Title") & "','" * Request.Form("A ddress_1") & "','" & Request.Form("A ddress_2") & "','" & Request.Form("C ity") & "','" &
Request.Form("C ounty") & "','" & Request.Form("P ost_Code") & "','" &
Request.Form("P hone_2") & "','" & Request.Form("F ax") & "','" &
Request.Form("W eb_Url") & "','" & Request.Form("e mail_address") & "','" &
Request.Form("D elivery") & "','" & Request.Form("N otes") & "')"

OUTPUT

INSERT * INTO customers (Company_Name, Category, Contact_Name,
Contact_Title, Address_1, Address_2, City, County, Post_Code, Phone_1,
Phone_2, Fax, Web_URL, email_Address, Delivery, Notes)
VALUES('','1',' ','','','addres s_2','1, 1','','','','', '','','','')

The text in questiuon is '1,1' When it should be '1','1' The SQL code should output that syntax but it isnt? Any ideas why?

thanks all, got it sorted

Jul 19 '05 #5
THE CORRECT SYNTAX IS
INSERT INTO [TABLE] (STRINGFIELD,IN TEGERFIELD,BOOL EANFIELD) VALUES ('MY
STRING',1,TRUE) ;

AS YOU CAN SEE THERE IS ONE VALID VALUE FOR EVERY FIELD:
STRINGFIELD='MY STRING'
INTEGERFIELD=1
BOOLEANFIELD=TR UE

TRY MACH YOUR VALUES OK?
AND BECAREFUL WITH * AND & WHEN YOU TRY TO JOIN YOUR QRY
Jul 19 '05 #6

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

Similar topics

3
2390
by: Chris Geerdink | last post by:
combo with PHP. what is wrong with the Javascript? else { include("mysql.php"); $query1 = mysql_query("INSERT INTO gbook (naam, email, text) VALUES ('".$_POST."', '".$_POST."', '".$_POST."')"); ?> <script language="JavaScript"> <!--
2
1756
by: Tony | last post by:
I found similar code for encoding/decoding strings in VB which works fine. However I wanted to use it in a C# projected and can't get it to work. When it executes the TransformFinalBlock() call at the end it always returns the error "System.Security.Cryptography.CryptographicException: Length of the data to decrypt is invalid." Can anyone see what I am doing wrong - I have tried playing with the lengths and the construction of the...
1
2460
by: aa | last post by:
When I am reading from local disk (d:), everithing is OK, but then I am reading from map disk I am geting the this error. Whats wrong. Thanks Server Error in '/Extra' Application. ---------------------------------------------------------------------------- ---- The specified user does not exist. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more...
3
2039
by: mahsa | last post by:
Hi do you know whats wrong with this code? <asp:HyperLink id="HLink_Help" runat="server" NavigateUrl='<%# "javascript:window.open('comments.aspx?id=1,width=500,height=600, scrollBars=yes');" %>'>Need Help?</asp:HyperLink> -- mahsa
3
1755
by: Vaidas Gudas | last post by:
I has web project on virtual pc, maked with framework 2.0. there I was used the method role.roleexists("admin") and everything was worked good. but when i replace this project on my local machine, where is installed both versions 1.1 and 2.0 of framework. And on the this method I am getting the error System.Web.HttpException was unhandled by user code ErrorCode=-2147467259 Message="Unable to connect to SQL Server database."...
4
3539
by: blah | last post by:
Hello everyone, Ive been trying to get my application to "click" on a button in another application using SendMessage, Ive gotten this far but Im not sure whats wrong with this code, here is the whole application (its small for testing purposes) and it seems that window wraps the text, at least when I preview this post: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing;
7
2230
by: Mike Barnard | last post by:
It's a simple test... VERY SIMPLE. But... In an external stlyesheet some attributes don't show. With the same styles cut and pasted to the test internally it works as expected. Anyone tell me why? Its probably sooooooo obvious, but it is 1.19 am! Thanks. www.thunderin.co.uk/
4
3080
by: LoneHunter01 | last post by:
Basically, I just need a general direction on where to go for this. Yes, this is for a school project, though it's strictly an optional one (and I have tried many solutions, one in-depth). We've only covered a few types of data struct (vectors, heaps, stacks, queues, deques, lists, linked lists, priority queues, trees, etc.). I need to be able to read in a file and keep track of the number of times a word appears and then print out based...
10
2353
by: joestevens232 | last post by:
Ok everything is good...I read in all my grades into each of the different arrays that they need to go in. Now Im trying to write a function that takes the grades and computes the average on a hundred point scale...for example: Student 1 7 quiz scores 9 9.33 8 10 5.5 8 10 ==> the 5.5 score should be dropped, returned value: 90.55 6 project scores 20 47.5 47 45 47.5 48 ==> returned value: 94.44 2 exam scores 83 87 ==>...
0
8718
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
9206
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
9066
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
8916
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
7802
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
6558
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
5899
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();...
1
3083
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
2383
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.