Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. 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 Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 5th, 2006, 03:35 AM
Authorized User
Join Date: Jan 2006
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Question

Please help me in this querry
strdml="INSERT INTO order (Id,orderdate,type,comm,disc,consigneename,lcno,da te,amount,expdate,buyerorderno,buyerorderdate,curr ency,remarks,commagent,style,model,deldate,unit)VA LUES ('"&Id&"','"&orderdate&"','"&otype&"','"&comm&"',' "&disc&"','"&consigneename&"','"&lcno&"','"&ldate& "','"&lamount&"','"&expdate&"','"&buyerorderno&"', '"&buyerorderdate&"','"&bcurrency&"','"&remarks&"' ,'"&commagent&"','"&style&"','"&model&"','"&deldat e&"','"&unit&"')"

Errror is Syntax error in INSERT INTO statement.

Reply With Quote
  #2 (permalink)  
Old January 5th, 2006, 05:22 AM
Friend of Wrox
Join Date: Jul 2003
Location: , , United Kingdom.
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post

Please post you question once only Ashwini - http://p2p.wrox.com/topic.asp?TOPIC_ID=38312

Reply With Quote
  #3 (permalink)  
Old January 5th, 2006, 01:31 PM
Friend of Wrox
Points: 2,101, Level: 18
Points: 2,101, Level: 18 Points: 2,101, Level: 18 Points: 2,101, Level: 18
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jul 2003
Location: , , .
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts

When inserting integer values only use double quotes. Single quotes are used for string values. I'm only guessing at this since you're trying to insert a value into the ID column which I'm hoping is an integer.

I don't know why you're inserting into an ID column when that value could be self-generating if you make this column an identity column, unless this is a foreign key. Its also probably not such a good idea to name a column ID in the first place. A much better approach would be to call that column OrderID to avoid any conflicts with reserved words.

Where you are inserting integers use:

" & ID & " and not '" & ID & "'

Hope this helps.


Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
question maheshraju ASP.NET 2.0 Basics 3 March 13th, 2008 08:54 AM
Question Ashwini Classic ASP Databases 3 January 10th, 2006 07:20 AM
Question? Calibus Classic ASP Databases 8 August 6th, 2004 08:25 AM
a question gorji C++ Programming 2 August 11th, 2003 07:41 AM

All times are GMT -4. The time now is 08:28 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.