find in database

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Henk Salomons

    #1

    find in database

    Question,

    Is it possible to use a AND in a find string, somthing like this:
    Db.recordset.fi nd("Collum1=Lon don AND Collum2=Amsterd am")

    In this syntax is doesn't work, is there a way to do this??

    Greetings Henk


  • Veign

    #2
    Re: find in database

    Find does not support AND / OR operators:


    --
    Chris Hanscom - Microsoft MVP (VB)
    Veign's Resource Center

    --

    "Henk Salomons" <salom722@plane t.nl> wrote in message
    news:d0nlva$jgn $1@reader11.wxs .nl...[color=blue]
    > Question,
    >
    > Is it possible to use a AND in a find string, somthing like this:
    > Db.recordset.fi nd("Collum1=Lon don AND Collum2=Amsterd am")
    >
    > In this syntax is doesn't work, is there a way to do this??
    >
    > Greetings Henk
    >
    >[/color]


    Comment

    • Veign

      #3
      Re: find in database

      Find does not support AND / OR operators:


      --
      Chris Hanscom - Microsoft MVP (VB)
      Veign's Resource Center

      --

      "Henk Salomons" <salom722@plane t.nl> wrote in message
      news:d0nlva$jgn $1@reader11.wxs .nl...[color=blue]
      > Question,
      >
      > Is it possible to use a AND in a find string, somthing like this:
      > Db.recordset.fi nd("Collum1=Lon don AND Collum2=Amsterd am")
      >
      > In this syntax is doesn't work, is there a way to do this??
      >
      > Greetings Henk
      >
      >[/color]


      Comment

      • Rob

        #4
        Re: find in database

        "Henk Salomons" <salom722@plane t.nl> wrote in news:d0nlva$jgn $1
        @reader11.wxs.n l:
        [color=blue]
        > Question,
        >
        > Is it possible to use a AND in a find string, somthing like this:
        > Db.recordset.fi nd("Collum1=Lon don AND Collum2=Amsterd am")
        >
        > In this syntax is doesn't work, is there a way to do this??
        >
        > Greetings Henk
        >
        >
        >[/color]

        Well Henk you can set a SQL string with an 'AND' operator in it:

        Dim strSQL as String
        strSQL = "SELECT * FROM MyTable WHERE Collum1 = 'London' AND Collum2 =
        'Amsterdam'"

        Once you've set the strSQL variable, the exact method of passing the
        string and obtaining the data will vary according to the data object you
        are using.

        Comment

        • Rob

          #5
          Re: find in database

          "Henk Salomons" <salom722@plane t.nl> wrote in news:d0nlva$jgn $1
          @reader11.wxs.n l:
          [color=blue]
          > Question,
          >
          > Is it possible to use a AND in a find string, somthing like this:
          > Db.recordset.fi nd("Collum1=Lon don AND Collum2=Amsterd am")
          >
          > In this syntax is doesn't work, is there a way to do this??
          >
          > Greetings Henk
          >
          >
          >[/color]

          Well Henk you can set a SQL string with an 'AND' operator in it:

          Dim strSQL as String
          strSQL = "SELECT * FROM MyTable WHERE Collum1 = 'London' AND Collum2 =
          'Amsterdam'"

          Once you've set the strSQL variable, the exact method of passing the
          string and obtaining the data will vary according to the data object you
          are using.

          Comment

          • Elef

            #6
            Re: find in database


            "Henk Salomons" <salom722@plane t.nl> ha scritto nel messaggio
            news:d0nlva$jgn $1@reader11.wxs .nl...[color=blue]
            > Question,
            >
            > Is it possible to use a AND in a find string, somthing like this:
            > Db.recordset.fi nd("Collum1=Lon don AND Collum2=Amsterd am"), 0,
            > adSearchForward , adBookmarkFirst
            >
            > In this syntax is doesn't work, is there a way to do this??
            >
            > Greetings Henk
            >
            >[/color]
            Try this (note apostrophes around town names):

            Db.recordset.fi nd("Collum1='Lo ndon' AND Collum2='Amster dam'"), 0,
            adSearchForward , adBookmarkFirst

            Bye
            Elef


            Comment

            • Elef

              #7
              Re: find in database


              "Henk Salomons" <salom722@plane t.nl> ha scritto nel messaggio
              news:d0nlva$jgn $1@reader11.wxs .nl...[color=blue]
              > Question,
              >
              > Is it possible to use a AND in a find string, somthing like this:
              > Db.recordset.fi nd("Collum1=Lon don AND Collum2=Amsterd am"), 0,
              > adSearchForward , adBookmarkFirst
              >
              > In this syntax is doesn't work, is there a way to do this??
              >
              > Greetings Henk
              >
              >[/color]
              Try this (note apostrophes around town names):

              Db.recordset.fi nd("Collum1='Lo ndon' AND Collum2='Amster dam'"), 0,
              adSearchForward , adBookmarkFirst

              Bye
              Elef


              Comment

              Working...