dcsimg
www.webdeveloper.com
Results 1 to 3 of 3

Thread: [RESOLVED] Using VB to select data from db using where and

  1. #1
    Join Date
    Mar 2011
    Posts
    2

    resolved [RESOLVED] Using VB to select data from db using where and

    I need to select some data from one mysql table, but i need to select it based on 2 criterias.

    here is my code:
    Query = ("SELECT * FROM table where farrangementnr=" & Criteria and fbord= & bord)

    my two variables Criteria and bord, contains data parsed from a previous page, both contains numbers, the Criteria part works, but when i add the bord variable, i get errors because i cant combine the two correctly.

    this is my error with the current code:
    Error Type:
    Sun ONE ASP VBScript compilation (0x800A03EA)
    Syntax error, unexpected "&"
    /bordudskriv.asp, line 17, column 83

    hope i made my self understandable, if not please ask.

    hope someone can help.

  2. #2
    Join Date
    Mar 2011
    Location
    Nijmegen
    Posts
    10

    help you

    your sql clause is not good in total:

    Query = ("SELECT * FROM table where farrangementnr=" & Criteria and fbord= & bord)

    change to:
    Query = ("SELECT * FROM table where farrangementnr=" & Criteria &" and fbord= " & bord)

    Hope this will help you

  3. #3
    Join Date
    Mar 2011
    Posts
    2
    thx that solved my problem.

    i am a smug at putting these queries together.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles