HighDots Forums  

Command Object Insert error

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Command Object Insert error in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
xybernaut
 
Posts: n/a

Default Command Object Insert error - 09-12-2006 , 09:04 AM






Hi, I am having trouble trying to figure out an error I have with DW created
Command Object. The error is below:

Microsoft OLE DB Provider for SQL Server error '80040e14'

Incorrect syntax near ')'.

/labeldivision/Customer/AddCreditCard.asp, line 37

Here is the code:

<%

if(request("NameOnCard") <> "") then Command1__Name = request("NameOnCard")

%>
<%

set Command1 = Server.CreateObject("ADODB.Command")
Command1.ActiveConnection = MM_ASPConn_STRING
Command1.CommandText = "INSERT INTO dbo.TblCreditCard (NameOnCard) VALUES ("
+ Replace(Command1__Name, "'", "''") + ") "
Command1.CommandType = 1
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Execute()

%>

I have looked all over trying to figure this out. I think it must e something
to do with the quotes but this is exactly the way that DW wrote it.



Reply With Quote
  #2  
Old   
Paul Whitham AdobeCommunityExpert
 
Posts: n/a

Default Re: Command Object Insert error - 09-14-2006 , 10:09 PM






Check that the database field is set up to accept text.

--
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver

Valleybiz Internet Design
www.valleybiz.net

"xybernaut" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
Hi, I am having trouble trying to figure out an error I have with DW
created
Command Object. The error is below:

Microsoft OLE DB Provider for SQL Server error '80040e14'

Incorrect syntax near ')'.

/labeldivision/Customer/AddCreditCard.asp, line 37

Here is the code:

%

if(request("NameOnCard") <> "") then Command1__Name =
request("NameOnCard")

%
%

set Command1 = Server.CreateObject("ADODB.Command")
Command1.ActiveConnection = MM_ASPConn_STRING
Command1.CommandText = "INSERT INTO dbo.TblCreditCard (NameOnCard) VALUES
("
+ Replace(Command1__Name, "'", "''") + ") "
Command1.CommandType = 1
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Execute()

%

I have looked all over trying to figure this out. I think it must e
something
to do with the quotes but this is exactly the way that DW wrote it.





Reply With Quote
Reply




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.