Toon posts:

[ASP] probleem bij zoeken

Pagina: 1
Acties:

Verwijderd

Topicstarter
Ik heb een zoek machine gemaakt, die vast zit aan een MSSQL db
velden:
naam2 (invoer veld)
branche2 (dropdown)
provincie2 (dropdown)
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
dim connection2
Dim SqlJunk2
Dim SQL
    set connection2 = server.createObject("adodb.connection")
    connection2.open MM_countdown_STRING
    set sqljunk2 = server.createobject("ADODB.recordset")
    with sqljunk2
    SQL =  "select bedrijf.naam as bedrijfsnaam, bedrijf.straat, bedrijf.huisnummer, bedrijf.postcode, bedrijf.plaatsnaam as plaatsnaam,  bedrijf.abonneenummer, bedrijf.URL from bedrijf where bedrijf.subbranche in (select id from subbranche where nl_naam like '%" &  request.form("branche2") & "%')"

     if not request.form("naam2") = "" then
        SQL = SQL & " and bedrijf.naam like '%" & request.form("naam2") & "%'"
         ' SQL = SQL & " and bedrijf.subbranche in (select id from subbranche where nl_naam like '%" &  request.form("branche2") & "%')"
     end if
       
       if not request.form("provincie2") = "" then
        SQL = SQL & " and bedrijf.plaats in (select id from plaats where provincie = '" &request.form("provincie2")& "')"
     end if

    .open SQL ,connection2,1,2
    end with

Nu is het zo dat het wel werkt, maar om resultaten te krijgen moet ik naam2 ingevuld hebben... en iik zou graag willen hebben dat er ook alleen op branche2 gezocht kan worden. iemand ideeen

Verwijderd

Topicstarter
lama, is opgelost

Verwijderd

Fijn dat je ook ff meld hoe

  • Janoz
  • Registratie: Oktober 2000
  • Laatst online: 28-08 12:00

Janoz

Moderator Devschuur®

!litemod

Staat wel in zijn volgende topic.

Ken Thompson's famous line from V6 UNIX is equaly applicable to this post:
'You are not expected to understand this'