|
| |
|
|
boddah
Posts: 24 Joined: 1/26/2004 Status: offline
|
Data type mismatch in criteria expression? - 1/26/2004 12:40:26
Can't understand why I'm getting this error, I've checked fields in database to ensure identical names. This code represents a searchresults page so that matching criteria in any of the fields in a form on the previous page return a match and show on screen. <% set Conn = server.CreateObject("ADODB.connection") Conn.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" & server.MapPath("agencydatabase.mdb") SQL = "select areaID, propID, proppropertytype, propnoofbedrooms, propgarage, propprice from property where " & vbcrlf SQL = SQL & "areaID = " & request.form("areaID") & " or " & vbcrlf SQL = SQL & "proppropertytype = " & request.form("proppropertytype") & " or " & vbcrlf SQL = SQL & "propnoofbedrooms = " & request.form("propnoofbedrooms") & " or " & vbcrlf SQL = SQL & "propgarage = " & request.form("propgarage") & " and " & vbcrlf SQL = SQL & "(propaddressl1 like '%" & request.form("keyword") & "%' or " & vbcrlf SQL = SQL & "propaddressl2 like '%" & request.form("keyword") & "%')" & vbcrlf Response.Write SQL set RS = Conn.Execute(SQL) do while not RS.eof%> <%=RS("propID")%><br> <%=RS("areaID")%><br> <%=RS("proppropertytype")%><br> <%=RS("propnoofbedrooms")%><br> <%=RS("propgarage")%><br> <%=RS("propprice")%><br> <%RS.movenext loop Conn.Close%> Thanks for any help.
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Data type mismatch in criteria expression? - 1/26/2004 12:49:37
What is the actual error? Are you leaving blank fields on your search form when searching?
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
boddah
Posts: 24 Joined: 1/26/2004 Status: offline
|
RE: Data type mismatch in criteria expression? - 1/26/2004 12:56:01
Actual error is... Microsoft JET Database Engine error '80040e07' Data type mismatch in criteria expression. /searchresult.asp, line 85 Yep it is an Access DB. Thanks for your help so far.
|
|
|
|
boddah
Posts: 24 Joined: 1/26/2004 Status: offline
|
RE: Data type mismatch in criteria expression? - 1/26/2004 12:59:14
Oh and that is with all fields completed so that a match should be made.
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Data type mismatch in criteria expression? - 1/27/2004 11:13:48
quote:
SQL = SQL & "propgarage = '" & request.form("propgarage") & "' Looks to me you're just missing your closing double quote: SQL = SQL & "propgarage = '" & request.form("propgarage") & "'"
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|