Results 1 to 6 of 6

Thread: Database connection

  1. #1

    Thread Starter
    Member
    Join Date
    May 2000
    Location
    Sweden
    Posts
    50

    Question Database connection

    What's wrong with this code????

    Code:
    Produkt = "Ton"
    adoPrimaryRS.Open "select PRODUKT,OLDARTNR,NEWARTNR,LEVARTNR from KROSSREF WHERE [PRODUKT] like '*" & Produkt & "*'", db, adOpenStatic, adLockOptimistic
    This should return all records containing "Ton", that is "Ton, tone, toner" and so on.
    But it doesn't return anything at all!?
    Wolf

    VB6 SP5

  2. #2
    Frenzied Member Ultimasnake's Avatar
    Join Date
    Feb 2002
    Location
    Amsterdam, holland
    Posts
    1,172
    i think it is because you use [produkt] for the row (or whatever) but also use PRODUKT for the search name :S...
    For my PC and MS Smartphone 2003 software visit
    http://www.ultimasoftware.nl

  3. #3

    Thread Starter
    Member
    Join Date
    May 2000
    Location
    Sweden
    Posts
    50
    Nope, allready tried that....
    Wolf

    VB6 SP5

  4. #4
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    use % as wildcards, not *
    -= a peet post =-

  5. #5

    Thread Starter
    Member
    Join Date
    May 2000
    Location
    Sweden
    Posts
    50

    Smile

    THANKS ALOT!!!
    That solved it
    Wolf

    VB6 SP5

  6. #6
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    good

    always use % when working with ADO, the good o'l DAO likes the * ADO will not tolerate them
    -= a peet post =-

Posting Permissions

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



Click Here to Expand Forum to Full Width