Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
<%@Language = "vbscript" %>
<%
Dim strSearch
Dim rsSearch
Dim conn
strSarch = Request.QueryString("txtSearch")
dim strconn
strconn="DRIVER=Microsoft Access Driver (*.mdb);DBQ="
strconn = strconn & Server.MapPath("property_users1.mdb")
set rsSearch = Server.CreateObject("ADODB.Recordset")
strSearch = "SELECT  Brief,Area,City,Country,Telephone " & "FROM [registration] " & "WHERE City LIKE  '" & Replace(strSarch, "'", "''") & "%' "

rsSearch.open strSearch, strconn, 2,2
<%
<table>
<%
while Not rsSearch.eof
<%<tr>rsSearch("Brief")</tr> %>
<%<tr>rsSearch("Area")</tr>%>
<%<tr>rsSearch("City")</tr>%>
<%<tr>rsSearch("Country")</tr>%>
<%<tr>rsSearch("Telephone")</tr>%>
rsSearch.Movenext
<%
<% </table> %>
Wend
%>
Posted
Comments
CPallini 14-Sep-10 8:01am    
What are the errors you get? Please modify your post to include the error messages.
dababy 14-Sep-10 8:05am    
My connection is Ok

where I inserted the table tag to display the search result and also the text field that will display the word search for.

Expected statement
line 19
LittleYellowBird 14-Sep-10 8:27am    
Hi, I notice that you have not taken CPallini's advice, you need to add the error messages to your original post. Also, try to explain the problem you are having, without a well explained question no one will be able to help you. Regards :)
dababy 14-Sep-10 8:47am    
Error Type:
Microsoft VBScript compilation (0x800A0400)
Expected statement
/property/html/property_shop.asp, line 19

OK, Where did you close the second <% ?!! I can see
VB
<%
Dim strSearch

but I can not see the close tag!
(and also some other Tags! )

One thing else! I am not sure but as much as I remember you have to use <%= for writing them in your page.
 
Share this answer
 
v4
Comments
dababy 16-Sep-10 9:47am    
Reason for my vote of 5
Automatic vote of 5 for accepting answer.
dababy 16-Sep-10 9:51am    
Thanks
I did that but now my output is being display outside the table tag where I really wanted it to display.


You can help me to look at the result page here.

http://www.shopaproperty.com/html/property_shop.asp
aidin Tajadod 16-Sep-10 12:19pm    
Sure, but first please update your question with the new code, you might miss something else.
thanks.
Looks like you are trying to nest <% %> code blocks... or maybe you didn't paste your code snippet correctly. In any event, it looks like you are using them incorrectly in a bunch of places. You put the VB inside the code blocks and the HTML outside of them. And if you want to return a string from them, you use <%= %> code blocks instead.
 
Share this answer
 
Comments
dababy 16-Sep-10 9:47am    
Reason for my vote of 5
Automatic vote of 5 for accepting answer.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900