Avatar billede guzzie Nybegynder
06. august 2001 - 13:29 Der er 15 kommentarer og
1 løsning

Count of Recordsets

I use the following sql
strSQL = \"SELECT * FROM fspSearch WHERE\"
strSQL = strSQL & \" (VNavn LIKE \'%\" & strKeyword & \"%\' and KNavn LIKE \'%\" & strKeyworda & \"%\' and VSocialPart LIKE \'%\" & strKeywordvsp &\"%\'  and VArbTyp1 LIKE \'%\" & strVArbTyp1 &\"%\'  and VArbTyp2 LIKE \'%\" & strVArbTyp2 &\"%\'  and VArbTyp3 LIKE \'%\" & strVArbTyp3 &\"%\'  and VArbTyp4 LIKE \'%\" & strVArbTyp4 &\"%\'  and VArbTyp5 LIKE \'%\" & strVArbTyp5 &\"%\'  and VArbTyp6 LIKE \'%\" & strVArbTyp6 &\"%\'  and VArbTyp7 LIKE \'%\" & strVArbTyp7 &\"%\'  and VArbTyp8 LIKE \'%\" & strVArbTyp8 &\"%\'  and VArbTyp9 LIKE \'%\" & strVArbTyp9 &\"%\'  and VArbTyp10 LIKE \'%\" & strVArbTyp10 &\"%\'  and VArbTyp11 LIKE \'%\" & strVArbTyp11 &\"%\'  and VArbTyp12 LIKE \'%\" & strVArbTyp12 &\"%\'  and VArbTyp13 LIKE \'%\" & strVArbTyp13 &\"%\' and VJobOrd1 LIKE \'%\" & strVJobOrd1 &\"%\' and VJobOrd2 LIKE \'%\" & strVJobOrd2 &\"%\' and VJobOrd3 LIKE \'%\" & strVJobOrd3 &\"%\' and VJobOrd4 LIKE \'%\" & strVJobOrd4 &\"%\' and VJobOrd5 LIKE \'%\" & strVJobOrd5 &\"%\' and VJobOrd6 LIKE \'%\" & strVJobOrd6 &\"%\' and VJobOrd7 LIKE \'%\" & strVJobOrd7 &\"%\' and VJobOrd8 LIKE \'%\" & strVJobOrd8 &\"%\')\"
Set rs = Con.Execute(strSQL)

Here how I thought the countSQL should be
but recieve errors :(

countSQL = \"Select Count(ID) FROM fspSearch WHERE\"
strSQL = strSQL & \" (VNavn LIKE \'%\" & strKeyword & \"%\' and KNavn LIKE \'%\" & strKeyworda & \"%\' and VSocialPart LIKE \'%\" & strKeywordvsp &\"%\'  and VArbTyp1 LIKE \'%\" & strVArbTyp1 &\"%\'  and VArbTyp2 LIKE \'%\" & strVArbTyp2 &\"%\'  and VArbTyp3 LIKE \'%\" & strVArbTyp3 &\"%\'  and VArbTyp4 LIKE \'%\" & strVArbTyp4 &\"%\'  and VArbTyp5 LIKE \'%\" & strVArbTyp5 &\"%\'  and VArbTyp6 LIKE \'%\" & strVArbTyp6 &\"%\'  and VArbTyp7 LIKE \'%\" & strVArbTyp7 &\"%\'  and VArbTyp8 LIKE \'%\" & strVArbTyp8 &\"%\'  and VArbTyp9 LIKE \'%\" & strVArbTyp9 &\"%\'  and VArbTyp10 LIKE \'%\" & strVArbTyp10 &\"%\'  and VArbTyp11 LIKE \'%\" & strVArbTyp11 &\"%\'  and VArbTyp12 LIKE \'%\" & strVArbTyp12 &\"%\'  and VArbTyp13 LIKE \'%\" & strVArbTyp13 &\"%\' and VJobOrd1 LIKE \'%\" & strVJobOrd1 &\"%\' and VJobOrd2 LIKE \'%\" & strVJobOrd2 &\"%\' and VJobOrd3 LIKE \'%\" & strVJobOrd3 &\"%\' and VJobOrd4 LIKE \'%\" & strVJobOrd4 &\"%\' and VJobOrd5 LIKE \'%\" & strVJobOrd5 &\"%\' and VJobOrd6 LIKE \'%\" & strVJobOrd6 &\"%\' and VJobOrd7 LIKE \'%\" & strVJobOrd7 &\"%\' and VJobOrd8 LIKE \'%\" & strVJobOrd8 &\"%\')\"

RS2 = Con.Execute(countSQL)


here the error i get
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error in WHERE clause.
/WEE_guzzie/search_advanceret.asp, line 233

line 233 is the following
RS2 = Con.Execute(countSQL)

Any help would be welcomed
Guzzie
Avatar billede prof2 Nybegynder
06. august 2001 - 13:30 #1
Du skal starte med:

\"Select Count(ID) as Antal FROM fspSearch WHERE\"
Avatar billede prof2 Nybegynder
06. august 2001 - 13:31 #2
Og så vil rs2(\"antal\") være antallet du skal bruge :)
Avatar billede madd Nybegynder
06. august 2001 - 13:31 #3
countSQL = \"Select Count(ID) FROM fspSearch WHERE\"
strSQL = strSQL & \" VNavn LIKE \'%\" & strKeyword & \"%\' and KNavn LIKE \'%\" & strKeyworda & \"%\' and VSocialPart LIKE \'%\" & strKeywordvsp &\"%\'  and VArbTyp1 LIKE \'%\" & strVArbTyp1 &\"%\'  and VArbTyp2 LIKE \'%\" & strVArbTyp2 &\"%\'  and VArbTyp3 LIKE \'%\" & strVArbTyp3 &\"%\'  and VArbTyp4 LIKE \'%\" & strVArbTyp4 &\"%\'  and VArbTyp5 LIKE \'%\" & strVArbTyp5 &\"%\'  and VArbTyp6 LIKE \'%\" & strVArbTyp6 &\"%\'  and VArbTyp7 LIKE \'%\" & strVArbTyp7 &\"%\'  and VArbTyp8 LIKE \'%\" & strVArbTyp8 &\"%\'  and VArbTyp9 LIKE \'%\" & strVArbTyp9 &\"%\'  and VArbTyp10 LIKE \'%\" & strVArbTyp10 &\"%\'  and VArbTyp11 LIKE \'%\" & strVArbTyp11 &\"%\'  and VArbTyp12 LIKE \'%\" & strVArbTyp12 &\"%\'  and VArbTyp13 LIKE \'%\" & strVArbTyp13 &\"%\' and VJobOrd1 LIKE \'%\" & strVJobOrd1 &\"%\' and VJobOrd2 LIKE \'%\" & strVJobOrd2 &\"%\' and VJobOrd3 LIKE \'%\" & strVJobOrd3 &\"%\' and VJobOrd4 LIKE \'%\" & strVJobOrd4 &\"%\' and VJobOrd5 LIKE \'%\" & strVJobOrd5 &\"%\' and VJobOrd6 LIKE \'%\" & strVJobOrd6 &\"%\' and VJobOrd7 LIKE \'%\" & strVJobOrd7 &\"%\' and VJobOrd8 LIKE \'%\" & strVJobOrd8 &\"%\'\"


Try that.. dont know if it works..!

Avatar billede nute Nybegynder
06. august 2001 - 13:31 #4
can you print out the whole SQL. Before you execute it, do:

response.write countSQL

and post the SQL here...

/nute
Avatar billede madd Nybegynder
06. august 2001 - 13:33 #5
Ah ja.. self. som prof2 siger :)

countSQL = \"Select Count(ID) AS Count FROM fspSearch WHERE\"
strSQL = strSQL & \" (VNavn LIKE \'%\" & strKeyword & \"%\' and KNavn LIKE \'%\" & strKeyworda & \"%\' and VSocialPart LIKE \'%\" & strKeywordvsp &\"%\'  and VArbTyp1 LIKE \'%\" & strVArbTyp1 &\"%\'  and VArbTyp2 LIKE \'%\" & strVArbTyp2 &\"%\'  and VArbTyp3 LIKE \'%\" & strVArbTyp3 &\"%\'  and VArbTyp4 LIKE \'%\" & strVArbTyp4 &\"%\'  and VArbTyp5 LIKE \'%\" & strVArbTyp5 &\"%\'  and VArbTyp6 LIKE \'%\" & strVArbTyp6 &\"%\'  and VArbTyp7 LIKE \'%\" & strVArbTyp7 &\"%\'  and VArbTyp8 LIKE \'%\" & strVArbTyp8 &\"%\'  and VArbTyp9 LIKE \'%\" & strVArbTyp9 &\"%\'  and VArbTyp10 LIKE \'%\" & strVArbTyp10 &\"%\'  and VArbTyp11 LIKE \'%\" & strVArbTyp11 &\"%\'  and VArbTyp12 LIKE \'%\" & strVArbTyp12 &\"%\'  and VArbTyp13 LIKE \'%\" & strVArbTyp13 &\"%\' and VJobOrd1 LIKE \'%\" & strVJobOrd1 &\"%\' and VJobOrd2 LIKE \'%\" & strVJobOrd2 &\"%\' and VJobOrd3 LIKE \'%\" & strVJobOrd3 &\"%\' and VJobOrd4 LIKE \'%\" & strVJobOrd4 &\"%\' and VJobOrd5 LIKE \'%\" & strVJobOrd5 &\"%\' and VJobOrd6 LIKE \'%\" & strVJobOrd6 &\"%\' and VJobOrd7 LIKE \'%\" & strVJobOrd7 &\"%\' and VJobOrd8 LIKE \'%\" & strVJobOrd8 &\"%\')\"

Sådan vil den se ud..
Avatar billede prof2 Nybegynder
06. august 2001 - 13:33 #6
I think I\'m right. Just use this:

\"Select Count(ID) as Antal FROM fspSearch WHERE\"

and RS2(\"antal\") will be the number you want !
Avatar billede guzzie Nybegynder
06. august 2001 - 13:40 #7
//prof2 that didnt work :(
//madd nor did yours
//hey nute
heres the whole sql :)

<%
strKeyword = Trim(Request.Form(\"VNavn\"))
strKeyworda = Trim(Request.Form(\"KNavn\"))
strKeywordvsp = Trim(Request.Form(\"VSocialPart\"))
strVArbTyp1 = Trim(Request.Form(\"VArbTyp1\"))
strVArbTyp2 = Trim(Request.Form(\"VArbTyp2\"))
strVArbTyp3 = Trim(Request.Form(\"VArbTyp3\"))
strVArbTyp4 = Trim(Request.Form(\"VArbTyp4\"))
strVArbTyp5 = Trim(Request.Form(\"VArbTyp5\"))
strVArbTyp6 = Trim(Request.Form(\"VArbTyp6\"))
strVArbTyp7 = Trim(Request.Form(\"VArbTyp7\"))
strVArbTyp8 = Trim(Request.Form(\"VArbTyp8\"))
strVArbTyp9 = Trim(Request.Form(\"VArbTyp9\"))
strVArbTyp10 = Trim(Request.Form(\"VArbTyp10\"))
strVArbTyp11 = Trim(Request.Form(\"VArbTyp11\"))
strVArbTyp12 = Trim(Request.Form(\"VArbTyp12\"))
strVArbTyp13 = Trim(Request.Form(\"VArbTyp13\"))
strVJobOrd1 = Trim(Request.Form(\"VJobOrd1\"))
strVJobOrd2 = Trim(Request.Form(\"VJobOrd2\"))
strVJobOrd3 = Trim(Request.Form(\"VJobOrd3\"))
strVJobOrd4 = Trim(Request.Form(\"VJobOrd4\"))
strVJobOrd5 = Trim(Request.Form(\"VJobOrd5\"))
strVJobOrd6 = Trim(Request.Form(\"VJobOrd6\"))
strVJobOrd7 = Trim(Request.Form(\"VJobOrd7\"))
strVJobOrd8 = Trim(Request.Form(\"VJobOrd8\"))

If Len(strKeyword) = 0 Then
\'    Response.Clear
\'    Response.Redirect(\"default.asp\")
Else
\'    strKeyword = Replace(strKeyword,strKeyworda,strKeywordt)
    strKeyword = Replace(strKeyword,\"\",\"\")
End If
strSQL = \"SELECT * FROM fspSearch WHERE\"
strSQL = strSQL & \" (VNavn LIKE \'%\" & strKeyword & \"%\' and KNavn LIKE \'%\" & strKeyworda & \"%\' and VSocialPart LIKE \'%\" & strKeywordvsp &\"%\'  and VArbTyp1 LIKE \'%\" & strVArbTyp1 &\"%\'  and VArbTyp2 LIKE \'%\" & strVArbTyp2 &\"%\'  and VArbTyp3 LIKE \'%\" & strVArbTyp3 &\"%\'  and VArbTyp4 LIKE \'%\" & strVArbTyp4 &\"%\'  and VArbTyp5 LIKE \'%\" & strVArbTyp5 &\"%\'  and VArbTyp6 LIKE \'%\" & strVArbTyp6 &\"%\'  and VArbTyp7 LIKE \'%\" & strVArbTyp7 &\"%\'  and VArbTyp8 LIKE \'%\" & strVArbTyp8 &\"%\'  and VArbTyp9 LIKE \'%\" & strVArbTyp9 &\"%\'  and VArbTyp10 LIKE \'%\" & strVArbTyp10 &\"%\'  and VArbTyp11 LIKE \'%\" & strVArbTyp11 &\"%\'  and VArbTyp12 LIKE \'%\" & strVArbTyp12 &\"%\'  and VArbTyp13 LIKE \'%\" & strVArbTyp13 &\"%\' and VJobOrd1 LIKE \'%\" & strVJobOrd1 &\"%\' and VJobOrd2 LIKE \'%\" & strVJobOrd2 &\"%\' and VJobOrd3 LIKE \'%\" & strVJobOrd3 &\"%\' and VJobOrd4 LIKE \'%\" & strVJobOrd4 &\"%\' and VJobOrd5 LIKE \'%\" & strVJobOrd5 &\"%\' and VJobOrd6 LIKE \'%\" & strVJobOrd6 &\"%\' and VJobOrd7 LIKE \'%\" & strVJobOrd7 &\"%\' and VJobOrd8 LIKE \'%\" & strVJobOrd8 &\"%\')\"

\'Con.Execute strSQL
Set rs = Con.Execute(strSQL)

countSQL = \"Select Count(ID) As count FROM fspSearch WHERE\"
strSQL = strSQL & \" (VNavn LIKE \'%\" & strKeyword & \"%\' and KNavn LIKE \'%\" & strKeyworda & \"%\' and VSocialPart LIKE \'%\" & strKeywordvsp &\"%\'  and VArbTyp1 LIKE \'%\" & strVArbTyp1 &\"%\'  and VArbTyp2 LIKE \'%\" & strVArbTyp2 &\"%\'  and VArbTyp3 LIKE \'%\" & strVArbTyp3 &\"%\'  and VArbTyp4 LIKE \'%\" & strVArbTyp4 &\"%\'  and VArbTyp5 LIKE \'%\" & strVArbTyp5 &\"%\'  and VArbTyp6 LIKE \'%\" & strVArbTyp6 &\"%\'  and VArbTyp7 LIKE \'%\" & strVArbTyp7 &\"%\'  and VArbTyp8 LIKE \'%\" & strVArbTyp8 &\"%\'  and VArbTyp9 LIKE \'%\" & strVArbTyp9 &\"%\'  and VArbTyp10 LIKE \'%\" & strVArbTyp10 &\"%\'  and VArbTyp11 LIKE \'%\" & strVArbTyp11 &\"%\'  and VArbTyp12 LIKE \'%\" & strVArbTyp12 &\"%\'  and VArbTyp13 LIKE \'%\" & strVArbTyp13 &\"%\' and VJobOrd1 LIKE \'%\" & strVJobOrd1 &\"%\' and VJobOrd2 LIKE \'%\" & strVJobOrd2 &\"%\' and VJobOrd3 LIKE \'%\" & strVJobOrd3 &\"%\' and VJobOrd4 LIKE \'%\" & strVJobOrd4 &\"%\' and VJobOrd5 LIKE \'%\" & strVJobOrd5 &\"%\' and VJobOrd6 LIKE \'%\" & strVJobOrd6 &\"%\' and VJobOrd7 LIKE \'%\" & strVJobOrd7 &\"%\' and VJobOrd8 LIKE \'%\" & strVJobOrd8 &\"%\')\"
response.write countSQL
RS2 = Con.Execute(countSQL)


If Not (rs.BOF Or rs.EOF) Then

    Response.Write \"<table border=0 cellspacing=0 cellpadding=1 width=\'767\'><tr><td width=\'127\' valign=top><img src=images/stamdata.gif></td><td valign=top><b>Søge resultater:</b>&nbsp;\"&strKeyword&\" &nbsp; \"&strKeyworda&\" &nbsp;\"&strKeywordt&\"&nbsp;\"&strVJobOrd1&\"&nbsp;\"&strVJobOrd2&\"&nbsp;\"&strVJobOrd3&\"&nbsp;\"&strVJobOrd4&\"&nbsp;\"&strVJobOrd5&\"&nbsp;\"&strVJobOrd6&\"&nbsp;\"&strVJobOrd7&\"&nbsp;\"&strVJobOrd8&\"<br><table border=0 cellspacing=1 cellpadding=0>\"
    Response.Write \"<tr align=\'left\' class=\"\"type\"\"><th><img src=images/s_virksomhed.gif></th><th><img src=images/s_kontaktperson.gif></th><th align=center><img src=images/s_socialpartner.gif></th><th align=center><img src=images/s_kontorarbejde.gif></th><th align=center><img src=images/s_lager.gif></th><th align=center><img src=images/s_rengoring.gif></th><th align=center><img src=images/s_type4.gif></th><th><img src=images/s_type5.gif></th><th align=center><img src=images/s_type6.gif></th><th align=center><img src=images/s_type7.gif></th><th align=center><img src=images/s_type8.gif></th><th align=center><img src=images/s_type9.gif></th><th align=center><img src=images/s_type10.gif></th><th align=center><img src=images/s_type11.gif></th><th align=center><img src=images/s_type12.gif></th><th align=center><img src=images/s_type13.gif></th><th align=center><img src=images/s_ordinar.gif></th><th align=center><img src=images/s_sprogskolejob.gif></th><th align=center><img src=images/s_praktik.gif></th><th align=center><img src=images/s_elev.gif></th><th align=center><img src=images/s_lontilskud.gif></th><th align=center><img src=images/s_revalidering.gif></th><th align=center><img src=images/s_fleksjob.gif></th><th align=center><img src=images/s_skanejob.gif></th></tr>\"
    i = 0
    if rs.BOF and rs.EOF Then
    else
    if NOT rs.BOF then
do while Not rs.EOF
i = i + 1
if (i mod 2 = 0) then
  BColor = \"#E9E9E9\"
else
  BColor = \"#E0E0E0\"
end if
      %>


It works fine without the count :)

hope this helps a little
Guzzie
Avatar billede prof2 Nybegynder
06. august 2001 - 13:45 #8
Is it the same error again ?
Avatar billede prof2 Nybegynder
06. august 2001 - 13:45 #9
There is a field in fspSearch called ID right ??
Avatar billede prof2 Nybegynder
06. august 2001 - 13:46 #10
Avatar billede nute Nybegynder
06. august 2001 - 13:49 #11
try:

Select Count(*) as antal FROM fspSearch WHERE
Avatar billede guzzie Nybegynder
06. august 2001 - 14:03 #12
prof same error the field is called VID but I get the same error
Select Count(VID) as antal FROM fspSearch WHERE
Microsoft OLE DB Provider for ODBC Drivers error \'80040e14\'

[Microsoft][ODBC Microsoft Access Driver] Syntax error in WHERE clause.

/WEE_guzzie/search_advanceret.asp, line 233


nute I also tried your suggestion but got the same error

I will have a look at the link you sent me
Avatar billede prof2 Nybegynder
06. august 2001 - 14:14 #13
Try this where the count thing is:

strSQL = \"SELECT count(vid) as antal FROM fspSearch WHERE\"
strSQL = strSQL & \" (VNavn LIKE \'%\" & strKeyword & \"%\' and KNavn LIKE \'%\" & strKeyworda & \"%\' and VSocialPart LIKE \'%\" & strKeywordvsp &\"%\'  and VArbTyp1 LIKE \'%\" & strVArbTyp1 &\"%\'  and VArbTyp2 LIKE \'%\" & strVArbTyp2 &\"%\'  and VArbTyp3 LIKE \'%\" & strVArbTyp3 &\"%\'  and VArbTyp4 LIKE \'%\" & strVArbTyp4 &\"%\'  and VArbTyp5 LIKE \'%\" & strVArbTyp5 &\"%\'  and VArbTyp6 LIKE \'%\" & strVArbTyp6 &\"%\'  and VArbTyp7 LIKE \'%\" & strVArbTyp7 &\"%\'  and VArbTyp8 LIKE \'%\" & strVArbTyp8 &\"%\'  and VArbTyp9 LIKE \'%\" & strVArbTyp9 &\"%\'  and VArbTyp10 LIKE \'%\" & strVArbTyp10 &\"%\'  and VArbTyp11 LIKE \'%\" & strVArbTyp11 &\"%\'  and VArbTyp12 LIKE \'%\" & strVArbTyp12 &\"%\'  and VArbTyp13 LIKE \'%\" & strVArbTyp13 &\"%\' and VJobOrd1 LIKE \'%\" & strVJobOrd1 &\"%\' and VJobOrd2 LIKE \'%\" & strVJobOrd2 &\"%\' and VJobOrd3 LIKE \'%\" & strVJobOrd3 &\"%\' and VJobOrd4 LIKE \'%\" & strVJobOrd4 &\"%\' and VJobOrd5 LIKE \'%\" & strVJobOrd5 &\"%\' and VJobOrd6 LIKE \'%\" & strVJobOrd6 &\"%\' and VJobOrd7 LIKE \'%\" & strVJobOrd7 &\"%\' and VJobOrd8 LIKE \'%\" & strVJobOrd8 &\"%\')\"
Avatar billede prof2 Nybegynder
06. august 2001 - 14:24 #14
Here are som stuff you can try!

This maybe?:
strSQL = \"SELECT count(vid) as antal FROM [fspSearch] WHERE\"

or this:

strSQL = \"SELECT count(vid) as antal FROM fspSearch WHERE (VNavn LIKE \'%\" & strKeyword & \"%\' and KNavn LIKE \'%\" & strKeyworda & \"%\' and VSocialPart LIKE \'%\" & strKeywordvsp &\"%\'  and VArbTyp1 LIKE \'%\" & strVArbTyp1 &\"%\'  and VArbTyp2 LIKE \'%\" & strVArbTyp2 &\"%\'  and VArbTyp3 LIKE \'%\" & strVArbTyp3 &\"%\'  and VArbTyp4 LIKE \'%\" & strVArbTyp4 &\"%\'  and VArbTyp5 LIKE \'%\" & strVArbTyp5 &\"%\'  and VArbTyp6 LIKE \'%\" & strVArbTyp6 &\"%\'  and VArbTyp7 LIKE \'%\" & strVArbTyp7 &\"%\'  and VArbTyp8 LIKE \'%\" & strVArbTyp8 &\"%\'  and VArbTyp9 LIKE \'%\" & strVArbTyp9 &\"%\'  and VArbTyp10 LIKE \'%\" & strVArbTyp10 &\"%\'  and VArbTyp11 LIKE \'%\" & strVArbTyp11 &\"%\'  and VArbTyp12 LIKE \'%\" & strVArbTyp12 &\"%\'  and VArbTyp13 LIKE \'%\" & strVArbTyp13 &\"%\' and VJobOrd1 LIKE \'%\" & strVJobOrd1 &\"%\' and VJobOrd2 LIKE \'%\" & strVJobOrd2 &\"%\' and VJobOrd3 LIKE \'%\" & strVJobOrd3 &\"%\' and VJobOrd4 LIKE \'%\" & strVJobOrd4 &\"%\' and VJobOrd5 LIKE \'%\" & strVJobOrd5 &\"%\' and VJobOrd6 LIKE \'%\" & strVJobOrd6 &\"%\' and VJobOrd7 LIKE \'%\" & strVJobOrd7 &\"%\' and VJobOrd8 LIKE \'%\" & strVJobOrd8 &\"%\')\"


or this:

strSQL = \"SELECT count(vid) as antal FROM fspSearch WHERE (\"
strSQL = strSQL & \"VNavn LIKE \'%\" & strKeyword & \"%\' and \"
strSQL = strSQL & \"KNavn LIKE \'%\" & strKeyworda & \"%\' and \"
strSQL = strSQL & \"VSocialPart LIKE \'%\" & strKeywordvsp &\"%\' and \"
strSQL = strSQL & \"VArbTyp1 LIKE \'%\" & strVArbTyp1 &\"%\' and \"
strSQL = strSQL & \"VArbTyp2 LIKE \'%\" & strVArbTyp2 &\"%\'  and \"
strSQL = strSQL & \"VArbTyp3 LIKE \'%\" & strVArbTyp3 &\"%\'  and \"
strSQL = strSQL & \"VArbTyp4 LIKE \'%\" & strVArbTyp4 &\"%\'  and \"
strSQL = strSQL & \"VArbTyp5 LIKE \'%\" & strVArbTyp5 &\"%\'  and \"
strSQL = strSQL & \"VArbTyp6 LIKE \'%\" & strVArbTyp6 &\"%\'  and \"
strSQL = strSQL & \"VArbTyp7 LIKE \'%\" & strVArbTyp7 &\"%\'  and \"
strSQL = strSQL & \"VArbTyp8 LIKE \'%\" & strVArbTyp8 &\"%\'  and \"
strSQL = strSQL & \"VArbTyp9 LIKE \'%\" & strVArbTyp9 &\"%\'  and \"
strSQL = strSQL & \"VArbTyp10 LIKE \'%\" & strVArbTyp10 &\"%\'  and \"
strSQL = strSQL & \"VArbTyp11 LIKE \'%\" & strVArbTyp11 &\"%\'  and \"
strSQL = strSQL & \"VArbTyp12 LIKE \'%\" & strVArbTyp12 &\"%\'  and \"
strSQL = strSQL & \"VArbTyp13 LIKE \'%\" & strVArbTyp13 &\"%\' and \"
strSQL = strSQL & \"VJobOrd1 LIKE \'%\" & strVJobOrd1 &\"%\' and \"
strSQL = strSQL & \"VJobOrd2 LIKE \'%\" & strVJobOrd2 &\"%\' and \"
strSQL = strSQL & \"VJobOrd3 LIKE \'%\" & strVJobOrd3 &\"%\' and \"
strSQL = strSQL & \"VJobOrd4 LIKE \'%\" & strVJobOrd4 &\"%\' and \"
strSQL = strSQL & \"VJobOrd5 LIKE \'%\" & strVJobOrd5 &\"%\' and \"
strSQL = strSQL & \"VJobOrd6 LIKE \'%\" & strVJobOrd6 &\"%\' and \"
strSQL = strSQL & \"VJobOrd7 LIKE \'%\" & strVJobOrd7 &\"%\' and \"
strSQL = strSQL & \"VJobOrd8 LIKE \'%\" & strVJobOrd8 &\"%\')\"

or this:

strSQL = \"SELECT count(vid) as antal FROM fspSearch WHERE\"
strSQL = strSQL & \" (VNavn LIKE \'%\" & strKeyword & \"%\' and KNavn LIKE \'%\" & strKeyworda & \"%\' and VSocialPart LIKE \'%\" & strKeywordvsp &\"%\' and VArbTyp1 LIKE \'%\" & strVArbTyp1 &\"%\' and VArbTyp2 LIKE \'%\" & strVArbTyp2 &\"%\' and VArbTyp3 LIKE \'%\" & strVArbTyp3 &\"%\' and VArbTyp4 LIKE \'%\" & strVArbTyp4 &\"%\' and VArbTyp5 LIKE \'%\" & strVArbTyp5 &\"%\' and VArbTyp6 LIKE \'%\" & strVArbTyp6 &\"%\' and VArbTyp7 LIKE \'%\" & strVArbTyp7 &\"%\' and VArbTyp8 LIKE \'%\" & strVArbTyp8 &\"%\' and VArbTyp9 LIKE \'%\" & strVArbTyp9 &\"%\' and VArbTyp10 LIKE \'%\" & strVArbTyp10 &\"%\' and VArbTyp11 LIKE \'%\" & strVArbTyp11 &\"%\' and VArbTyp12 LIKE \'%\" & strVArbTyp12 &\"%\' and VArbTyp13 LIKE \'%\" & strVArbTyp13 &\"%\' and VJobOrd1 LIKE \'%\" & strVJobOrd1 &\"%\' and VJobOrd2 LIKE \'%\" & strVJobOrd2 &\"%\' and VJobOrd3 LIKE \'%\" & strVJobOrd3 &\"%\' and VJobOrd4 LIKE \'%\" & strVJobOrd4 &\"%\' and VJobOrd5 LIKE \'%\" & strVJobOrd5 &\"%\' and VJobOrd6 LIKE \'%\" & strVJobOrd6 &\"%\' and VJobOrd7 LIKE \'%\" & strVJobOrd7 &\"%\' and VJobOrd8 LIKE \'%\" & strVJobOrd8 &\"%\')\"
Avatar billede prof2 Nybegynder
06. august 2001 - 14:26 #15
Maybe you can\'t see any changes but copy it all, and test it. There\'s something changed.

The last one can maybe work, because I have removed some spaces! Try it!
Avatar billede guzzie Nybegynder
06. august 2001 - 15:00 #16
Yippeeeeeeee :)


this one worked perfectly :)
strSQL = \"SELECT count(vid) as antal FROM fspSearch WHERE (\"
strSQL = strSQL & \"VNavn LIKE \'%\" & strKeyword & \"%\' and \"
strSQL = strSQL & \"KNavn LIKE \'%\" & strKeyworda & \"%\' and \"
strSQL = strSQL & \"VSocialPart LIKE \'%\" & strKeywordvsp &\"%\' and \"
strSQL = strSQL & \"VArbTyp1 LIKE \'%\" & strVArbTyp1 &\"%\' and \"
strSQL = strSQL & \"VArbTyp2 LIKE \'%\" & strVArbTyp2 &\"%\'  and \"
strSQL = strSQL & \"VArbTyp3 LIKE \'%\" & strVArbTyp3 &\"%\'  and \"
strSQL = strSQL & \"VArbTyp4 LIKE \'%\" & strVArbTyp4 &\"%\'  and \"
strSQL = strSQL & \"VArbTyp5 LIKE \'%\" & strVArbTyp5 &\"%\'  and \"
strSQL = strSQL & \"VArbTyp6 LIKE \'%\" & strVArbTyp6 &\"%\'  and \"
strSQL = strSQL & \"VArbTyp7 LIKE \'%\" & strVArbTyp7 &\"%\'  and \"
strSQL = strSQL & \"VArbTyp8 LIKE \'%\" & strVArbTyp8 &\"%\'  and \"
strSQL = strSQL & \"VArbTyp9 LIKE \'%\" & strVArbTyp9 &\"%\'  and \"
strSQL = strSQL & \"VArbTyp10 LIKE \'%\" & strVArbTyp10 &\"%\'  and \"
strSQL = strSQL & \"VArbTyp11 LIKE \'%\" & strVArbTyp11 &\"%\'  and \"
strSQL = strSQL & \"VArbTyp12 LIKE \'%\" & strVArbTyp12 &\"%\'  and \"
strSQL = strSQL & \"VArbTyp13 LIKE \'%\" & strVArbTyp13 &\"%\' and \"
strSQL = strSQL & \"VJobOrd1 LIKE \'%\" & strVJobOrd1 &\"%\' and \"
strSQL = strSQL & \"VJobOrd2 LIKE \'%\" & strVJobOrd2 &\"%\' and \"
strSQL = strSQL & \"VJobOrd3 LIKE \'%\" & strVJobOrd3 &\"%\' and \"
strSQL = strSQL & \"VJobOrd4 LIKE \'%\" & strVJobOrd4 &\"%\' and \"
strSQL = strSQL & \"VJobOrd5 LIKE \'%\" & strVJobOrd5 &\"%\' and \"
strSQL = strSQL & \"VJobOrd6 LIKE \'%\" & strVJobOrd6 &\"%\' and \"
strSQL = strSQL & \"VJobOrd7 LIKE \'%\" & strVJobOrd7 &\"%\' and \"
strSQL = strSQL & \"VJobOrd8 LIKE \'%\" & strVJobOrd8 &\"%\')\"


thanks again
Guzzie
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester