|
|
 |
| Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Basics section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |
|

April 17th, 2007, 10:15 AM
|
|
Wrox Author
Points: 12,827, Level: 49 |
|
|
Join Date: Oct 2005
Location: Akron, Ohio, USA.
Posts: 4,029
Thanks: 1
Thanked 42 Times in 42 Posts
|
|
Out of place means that the " is does not fall at the correct position in the string.
For example: Response.Write("This is a strin"g)
Would generate the same error that you are getting: Unterminated String constant. In the above example the 2nd " is out of place as it should encompass the entire string do doing this:
Response.Write("This is a string")
Corrects the error.
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
|

April 17th, 2007, 10:21 AM
|
|
Authorized User
|
|
Join Date: Jun 2006
Location: Colorado Springs, CO
Posts: 36
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
Okay, I've simplifed the string as much as possible to this:
set rsInsert = conn.Execute ("INSERT INTO user (lastname) values ('" & lastname & "')")
It appears there are matching parens and single, double quotes. What am I missing here? I'm being dense obviously.
|

April 17th, 2007, 10:26 AM
|
|
Wrox Author
Points: 12,827, Level: 49 |
|
|
Join Date: Oct 2005
Location: Akron, Ohio, USA.
Posts: 4,029
Thanks: 1
Thanked 42 Times in 42 Posts
|
|
This looks correct and it should have cleared up the Unterminated string contant error. If you are still recieving problems what value does the variable lastname contain?
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
|

April 17th, 2007, 10:39 AM
|
|
Authorized User
|
|
Join Date: Jun 2006
Location: Colorado Springs, CO
Posts: 36
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
Here's the latest error:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'user'.
|

April 17th, 2007, 10:45 AM
|
|
Wrox Author
Points: 12,827, Level: 49 |
|
|
Join Date: Oct 2005
Location: Akron, Ohio, USA.
Posts: 4,029
Thanks: 1
Thanked 42 Times in 42 Posts
|
|
Write out your sql statement. What is its literal value?
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
|

April 17th, 2007, 10:51 AM
|
|
Authorized User
|
|
Join Date: Jun 2006
Location: Colorado Springs, CO
Posts: 36
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
Come again? Refer back to being dense.
|

April 17th, 2007, 10:54 AM
|
|
Wrox Author
Points: 12,827, Level: 49 |
|
|
Join Date: Oct 2005
Location: Akron, Ohio, USA.
Posts: 4,029
Thanks: 1
Thanked 42 Times in 42 Posts
|
|
Refer to my second post about how to write out your sql statement. This will give you its literal value.
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
|

April 17th, 2007, 11:02 AM
|
|
Authorized User
|
|
Join Date: Jun 2006
Location: Colorado Springs, CO
Posts: 36
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
This is what the response.write returns:
INSERT INTO user (lastname) values (' ')
|

April 17th, 2007, 11:08 AM
|
|
Wrox Author
Points: 12,827, Level: 49 |
|
|
Join Date: Oct 2005
Location: Akron, Ohio, USA.
Posts: 4,029
Thanks: 1
Thanked 42 Times in 42 Posts
|
|
User is a reserved keyword in TSQL (MSSQL Server anyway) and you need to reference it like this: INSERT INTO [user](column) values(value)
Also, it is a good idea to refrain from nameing tables and columns that use SQL Keywords if for no other reason, to avoid these types of situations.
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
|

April 17th, 2007, 11:26 AM
|
|
Authorized User
|
|
Join Date: Jun 2006
Location: Colorado Springs, CO
Posts: 36
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
Makes sense and I should have thought of that. Fixed that problem, but no data is getting inserted into the table. Here's the lastest response.write:
INSERT INTO usertbl (lastname) values (' ')
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |