Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
Old 10-01-2004, 09:32 AM Feet and Inches
frik's Avatar
Average Talker

Posts: 26
Location: SOuth Africa
Trades: 0
On my database I have a height column and the values are in feet and inches eg 5'10". When a new value is send to the database it is accepted an written to the database. When I want to retrieve this value from the databse i do encounter problems

strWhereClause = strWhereClause & " height LIKE '" & Request.Form("height") & "%'"

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'height LIKE '5' 5"%''.

How Can I rectify it ?

Your help is appreciatexd
frik is offline
Reply With Quote
View Public Profile Visit frik's homepage!
 
 
Register now for full access!
Old 10-01-2004, 09:19 PM
vivekar's Avatar
Webmaster Talker

Posts: 612
Trades: 0
When inserting quoted information, you should use 2 single quotes and 2 double quotes.

like 5'' 3"".
That's the escape chars.

dim h

h = CheckString(Trim(Request.Form("height")))
-----------
Function CheckString(string)
if string = "" then string = " "
CheckString = Replace(string, "'", "''")
CheckString = Replace(string, """, """")
End Function
-----------

Now use the sql statement.
__________________

Please login or register to view this content. Registration is FREE
(Active since 2003) |
Please login or register to view this content. Registration is FREE
vivekar is offline
Reply With Quote
View Public Profile Visit vivekar's homepage!
 
Reply     « Reply to Feet and Inches
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.09562 seconds with 12 queries