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("Company_Name") & "','" &
Request.Form("Category") & "','" * Request.Form("Contact_Name") & "','" &
Request.Form("Contact_Title") & "','" * Request.Form("Address_1") & "','" &
Request.Form("Address_2") & "','" & Request.Form("City") & "','" &
Request.Form("County") & "','" & Request.Form("Post_Code") & "','" &
Request.Form("Phone_2") & "','" & Request.Form("Fax") & "','" &
Request.Form("Web_Url") & "','" & Request.Form("email_address") & "','" &
Request.Form("Delivery") & "','" & Request.Form("Notes") & "')"
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','','','','address_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? 5 1998
Do a Response.Write on JUST the two vaules in question once.
--
----------------------------------------------------------
Curt Christianson (Software_AT_Darkfalz.Com)
Owner/Lead Designer, DF-Software http://www.Darkfalz.com
---------------------------------------------------------
...Offering free scripts & code snippits for everyone...
---------------------------------------------------------
"Mike M" <mi**@mack1.karoo.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("Company_Name") & "','" & Request.Form("Category") & "','" * Request.Form("Contact_Name") & "','" & Request.Form("Contact_Title") & "','" * Request.Form("Address_1") & "','"
& Request.Form("Address_2") & "','" & Request.Form("City") & "','" & Request.Form("County") & "','" & Request.Form("Post_Code") & "','" & Request.Form("Phone_2") & "','" & Request.Form("Fax") & "','" & Request.Form("Web_Url") & "','" & Request.Form("email_address") & "','" & Request.Form("Delivery") & "','" & Request.Form("Notes") & "')"
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','','','','address_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?
Whats the " * Request.Form" all about?
I think youll find its because of that typo.
The & is next door ;-)
"Mike M" <mi**@mack1.karoo.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("Company_Name") & "','" & Request.Form("Category") & "','" * Request.Form("Contact_Name") & "','" & Request.Form("Contact_Title") & "','" * Request.Form("Address_1") & "','"
& Request.Form("Address_2") & "','" & Request.Form("City") & "','" & Request.Form("County") & "','" & Request.Form("Post_Code") & "','" & Request.Form("Phone_2") & "','" & Request.Form("Fax") & "','" & Request.Form("Web_Url") & "','" & Request.Form("email_address") & "','" & Request.Form("Delivery") & "','" & Request.Form("Notes") & "')"
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','','','','address_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?
"Mike M" <mi**@mack1.karoo.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("Company_Name") & "','" & Request.Form("Category") & "','" * Request.Form("Contact_Name") & "','" & Request.Form("Contact_Title") & "','" * Request.Form("Address_1") & "','"
& Request.Form("Address_2") & "','" & Request.Form("City") & "','" & Request.Form("County") & "','" & Request.Form("Post_Code") & "','" & Request.Form("Phone_2") & "','" & Request.Form("Fax") & "','" & Request.Form("Web_Url") & "','" & Request.Form("email_address") & "','" & Request.Form("Delivery") & "','" & Request.Form("Notes") & "')"
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','','','','address_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
THE CORRECT SYNTAX IS
INSERT INTO [TABLE] (STRINGFIELD,INTEGERFIELD,BOOLEANFIELD) VALUES ('MY
STRING',1,TRUE);
AS YOU CAN SEE THERE IS ONE VALID VALUE FOR EVERY FIELD:
STRINGFIELD='MY STRING'
INTEGERFIELD=1
BOOLEANFIELD=TRUE
TRY MACH YOUR VALUES OK?
AND BECAREFUL WITH * AND & WHEN YOU TRY TO JOIN YOUR QRY This discussion thread is closed Replies have been disabled for this discussion. Similar topics
3 posts
views
Thread by Chris Geerdink |
last post: by
|
2 posts
views
Thread by Tony |
last post: by
|
1 post
views
Thread by aa |
last post: by
|
3 posts
views
Thread by mahsa |
last post: by
|
3 posts
views
Thread by Vaidas Gudas |
last post: by
|
4 posts
views
Thread by blah |
last post: by
|
7 posts
views
Thread by Mike Barnard |
last post: by
| | | | | | | | | | | | |