Code Bank
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingCode Bank

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old September 15th, 2004, 08:47 AM
Ximenao Ximenao is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 8 Ximenao User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Exclamation Please HELP!! this dummy...

Hello anyone out there,
Okay, this is my problem. I'm designing a site with one page that links to a database to search for equipment. I recently redesigned the site, ie, changed the navigation bar and menu links underneath (No images in that one). But now when I uploaded the page, there is new error message now—

"Microsoft VBScript compilation error '800a0409'
Unterminated string constant
/parts.asp, line 178
sql="select * from product where (Product_ID like"

Here is the code that came along with it—

<table>
<%'insert code for display the search results%>
<!--#include file=capamax/conn.asp -->
<!--#include file=capamax/htmlcode.asp -->
<%
if len(request("itemname"))>=3 and request("eaction")="search" then
if request("item")="Product_ID" then
sql="select * from product where (Product_ID like
'"&"%"&HTMLEncode(request("itemname"))&"%"&"' ) or (Alternate_Part_ID like
'"&"%"&HTMLEncode(request("itemname"))&"%"&"' ) order by ID"
end if
if request("item")="Description" then
sql="select * from product where Description like
'"&"%"&HTMLEncode(request("itemname"))&"%"&"' order by ID"
end if
%>
<%
set rs=server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,3,2
if not rs.eof then
if request("page")<>"" then
page=cint(request("page"))
else
page=1
end if
if request("line")<>"" then
line=cint(request("line"))
else
line=80
end if
if page>(rs.RecordCount-1)\line+1 then

response.write("设置不合理,错误!")

response.end
end if
rs.PageSize=line
rs.AbsolutePage=page

%>
</table>

Any help would be greatly, greatly, greatly appreciated. But please keep in mind that I'm just learning ASP so please be gentle.

Thanks in advance.

Reply With Quote
  #2  
Old September 15th, 2004, 11:55 AM
selwonk's Avatar
selwonk selwonk is offline
Contributing User
ASP Free Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2004
Posts: 2,942 selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 6 Days 9 h 49 m 28 sec
Reputation Power: 62
If this line is broken by carriage returns, it just needs putting back on to 1 line:
Code:
sql="select * from product where (Product_ID like 
'"&"%"&HTMLEncode(request("itemname"))&"%"&"' ) or (Alternate_Part_ID like 
'"&"%"&HTMLEncode(request("itemname"))&"%"&"' ) order by ID"
i.e.
Code:
sql="select * from product where (Product_ID like '"&"%"&HTMLEncode(request("itemname"))&"%"&"' ) or (Alternate_Part_ID like '"&"%"&HTMLEncode(request("itemname"))&"%"&"' ) order by ID"
MK

Reply With Quote
  #3  
Old September 15th, 2004, 08:13 PM
Ximenao Ximenao is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 8 Ximenao User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Thanks

Thanks alot for the advice, but I'm still having problems. It still says "Unterminated String Content" but with the whole line now,
" Microsoft VBScript compilation error '800a0409'
Unterminated string constant
/parts.asp, line 178
sql="select * from product where (Product_ID like' "&"%"&HTMLEncode(request("itemname"))&"%"&"' ) or (Alternate_Part_ID like"

What do I do now?

Reply With Quote
  #4  
Old September 16th, 2004, 03:24 AM
selwonk's Avatar
selwonk selwonk is offline
Contributing User
ASP Free Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2004
Posts: 2,942 selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 6 Days 9 h 49 m 28 sec
Reputation Power: 62
The line is still not complete. Scroll to the right of my code box - there is more text...

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingCode Bank > Please HELP!! this dummy...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway