CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 SQL error Incorrect syntax near

Print topic Send  topic

Author Message
rdelgado


Posts: 8
Posted: 06/26/2006, 2:43 PM

Hi,
All of a sudden I've got pages that were tested and working, failing with "Incorrect syntax near" ..

It seems that when ever an apostrophe is entered in a text field sql server interprets it as a delimeter.

Example: Bob's Fish House

Retrurns error Incorrect syntax near "s"

I also noticed it only happens on pages that were recently generated and uploaded . Older existing pages work fine.

???? any ideas

thanks
View profile  Send private message
marcwolf


Posts: 361
Posted: 06/27/2006, 6:52 AM

Hi there

This is a common problem with many databases.

The easiest way to get around it to have a routine that will clean up these quotes.

Something like below...

Also check out to see if your DB has any escape characters. Some use the '/' so you can replace a ' with a /' and the DB will be happy.


  
Function SQLquote (s)  
	if isEmpty(s) or isNull(s) then  
		SQLquote = "NULL"  
	else  
		SQLquote = "'" & Replace( s, "'", "''") & "'"  
	end if  
End Function  

Take Care

Dave
_________________
' Coding Coding Coding
Keep Those Keyboards Coding.
Raw Code!!!!!!!
View profile  Send private message
rdelgado


Posts: 8
Posted: 06/27/2006, 6:11 PM

You're right... but, that was not the problem.

The pages that failed were CCS generated pages. Those I had handcrafted code in to manipulate strings were fine.

Turns out, after doing a "Publish Page" on one page vs a "Quick Publish Page" the problem resolved itself on all pages. I assume one of the common files was trampled on during a previous incomplete publish.

I'd had a similar problem before, I could not explain. It was corrected with a full page publish. I'm just so hooked on the quick publish, I never think to do a full page publish.

Next time before I spin my wheels, I'll do a standard page publish first....

Cheers and thanks...

View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.