Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
greska u kodu!?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side
View previous topic :: View next topic  
Author Message
fulspectrum



Joined: 20 Nov 2003
Posts: 296
Location: Ljubljana <>Split

PostPosted: 04.03.2004 13:53    Post subject: greska u kodu!? Add user to your forum ignore list Reply with quote

Ovo je greska koju mi javlja:

Microsoft JET Database Engine (0x80040E14)
Syntax error (missing operator) in query expression 'and podrucje = sjd and tip = 1'.
/dv/rezultatiz.asp, line 195

A ovo je line 195:

Code:
strSQL = "SELECT * FROM Iznajmljivanje where " & upit1 & " and podrucje = '" & Request.Form("podrucje") & "' and tip = " & Request.Form("tip") & " ORDER BY ID ASC;"


e, di je sad taj missing operator?
Back to top
View user's profile Send private message Send e-mail Visit poster's website
nidzho



Joined: 04 Mar 2004
Posts: 2
Location: Pula

PostPosted: 04.03.2004 14:33    Post subject: Add user to your forum ignore list Reply with quote

Jesi postavio upit1? Ili je prazan string?
Ubaci
Code:
Response.Write strSQL
i pogledaj gdje si fulo Smile
Back to top
View user's profile Send private message
fulspectrum



Joined: 20 Nov 2003
Posts: 296
Location: Ljubljana <>Split

PostPosted: 04.03.2004 14:38    Post subject: Add user to your forum ignore list Reply with quote

Jesam.


Code:
Dim upit1
Select Case Request.Form("cijena")

Case "nula"
upit1="cijena"

Case "prva"
upit1="cijena <= 20"

Case "druga"
upit1="cijena > 20 and cijena <= 30"

Case "treca"
upit1="cijena > 30 and cijena <= 50"

Case "cetvrta"
upit1="cijena > 50"

End Select
Back to top
View user's profile Send private message Send e-mail Visit poster's website
fulspectrum



Joined: 20 Nov 2003
Posts: 296
Location: Ljubljana <>Split

PostPosted: 04.03.2004 14:45    Post subject: Add user to your forum ignore list Reply with quote

sad mi javlja ovo:

Data type mismatch in criteria expression.


tj. da je greska u:

Code:
rsIznajmljivanje.Open strSQL, strcon, adOpenStatic
Back to top
View user's profile Send private message Send e-mail Visit poster's website
nidzho



Joined: 04 Mar 2004
Posts: 2
Location: Pula

PostPosted: 04.03.2004 14:46    Post subject: Add user to your forum ignore list Reply with quote

Code:
Case "nula"
upit1 = "cijena"


U tom slučaju, SQL glasi:
Code:
SELECT * FROM Iznajmljivanje where cijena and podrucje = 'nesto' and tip = 1 ORDER BY ID ASC;"

Obrati pažnju na WHERE cijena AND podrucje... Missing operator? Very Happy
Back to top
View user's profile Send private message
fulspectrum



Joined: 20 Nov 2003
Posts: 296
Location: Ljubljana <>Split

PostPosted: 04.03.2004 15:06    Post subject: Add user to your forum ignore list Reply with quote

Ne kuzim. Cijena je vec definirana pod "upit1" a podrucje mi preuzima iz forme sa stranice. Ne znam sta nedostaje?
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vedran



Joined: 08 Sep 2003
Posts: 458

PostPosted: 04.03.2004 15:20    Post subject: Add user to your forum ignore list Reply with quote

Ukoliko je case "nula onda ti je upit1 = "cijena"
i kada se sve to ubaci u sql upit nema smisla..

Code:

strSQL = "SELECT * FROM Iznajmljivanje where " & upit1 & " and podrucje = '" & Request.Form("podrucje") & "' and tip = " & Request.Form("tip") & " ORDER BY ID ASC;"


i onda ispada ovako where cijena and..

a cijenu bi trebao usprediti s necim kao sto je u ostali slucajvema(case)
Npr-
cijena <= 20 ili cijena = 50
.

_________________
http://www.hocusvojweb.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
fulspectrum



Joined: 20 Nov 2003
Posts: 296
Location: Ljubljana <>Split

PostPosted: 04.03.2004 15:31    Post subject: Add user to your forum ignore list Reply with quote

a sta u slucaju ako hocu da mi trazi sve cijene, dakle i pojedinacno i sve (ovisno sta korisnik izabere)? Kako onda postaviti case?

U svakom slucaju i s tim i bez mi javlja ovu prvu gresku- missing operator.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vedran



Joined: 08 Sep 2003
Posts: 458

PostPosted: 04.03.2004 18:26    Post subject: Add user to your forum ignore list Reply with quote

To mozes rijesiti sa dva upita..ovisno dali je korisnik odabrao da trazi sve cijene ili ukoliko ima oredeno..

Quote:

IF Request.Form("cijena") = "" THEN
' Korisnik nije izabrao cijenu pa mu se ispisuje bez obzira na cijenu

strSQL = "SELECT * FROM Iznajmljivanje where podrucje = '" & Request.Form("podrucje") & "' and tip = " & Request.Form("tip") & " ORDER BY ID ASC;"

else
'Korisnik je izabrao cijenu

strSQL = "SELECT * FROM Iznajmljivanje where " & upit1 & " and podrucje = '" & Request.Form("podrucje") & "' and tip = " & Request.Form("tip") & " ORDER BY ID ASC;"

end if

_________________
http://www.hocusvojweb.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
fulspectrum



Joined: 20 Nov 2003
Posts: 296
Location: Ljubljana <>Split

PostPosted: 04.03.2004 18:31    Post subject: Add user to your forum ignore list Reply with quote

Ok, hvala.
Svejedno greska stoji:

Syntax error (missing operator) in query expression 'and podrucje = 'sjd' and tip = 1'.

i onda me usmjeri na line:

Quote:
rsIznajmljivanje.Open strSQL, strcon, adOpenStatic
:Data type mismatch in criteria expression.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vedran



Joined: 08 Sep 2003
Posts: 458

PostPosted: 04.03.2004 18:50    Post subject: Add user to your forum ignore list Reply with quote

fulspectrum wrote:
Ok, hvala.

i onda me usmjeri na line:

Quote:
rsIznajmljivanje.Open strSQL, strcon, adOpenStatic
:Data type mismatch in criteria expression.


a kaj ti je adOpenStatic

_________________
http://www.hocusvojweb.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
fulspectrum



Joined: 20 Nov 2003
Posts: 296
Location: Ljubljana <>Split

PostPosted: 04.03.2004 18:56    Post subject: Add user to your forum ignore list Reply with quote

Vjerovatno ostalo od onoga sa izlistavanjem stranica, ali to nista nema veze, jer je greska i dalje tu.
Nego nesto sam otkrila, to pretrazivanje radi savrseno ako trazim po postavkama koje za koje nemam rezultat u bazi. Recimo imam apartman na hvaru za 50EUR/dan i kad to odaberem javlja gresku, a kda neku drugu kombinaciju onda uredno javlja kako trazen nekretnine nema u bazi. Cudno.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vedran



Joined: 08 Sep 2003
Posts: 458

PostPosted: 04.03.2004 21:13    Post subject: Add user to your forum ignore list Reply with quote

Ako ne radi ni kada koristis onaj sql upit sa if then else.. onda stvarno neznam..

Postaj full code ako ti se da.. mozda nađemo gresku..

_________________
http://www.hocusvojweb.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group