Results 1 to 6 of 6

Thread: Another (maybe simple) ADO question

  1. #1

    Thread Starter
    Lively Member WiseGuy's Avatar
    Join Date
    Apr 2002
    Location
    Zierikzee, The Netherlands
    Posts
    98

    Another (maybe simple) ADO question

    I want to know how I can convert this DOA code:

    Code:
        Case CMD_ADDRCD, CMD_EDITRCD, CMD_DELRCD
          FindCrit = "ArtikelID>=" & GetParmInString(gsFormParm, 2)
         datPrimaryRS.Recordset.FindFirst (FindCrit)
          If (datPrimaryRS.Recordset.RecordCount <> 0) And _
             datPrimaryRS.Recordset.NoMatch Then
            datPrimaryRS.Recordset.MoveFirst
          End If
    I though it would be something like this, it is just that NoMatch is not accepted:

    Code:
        Case CMD_ADDRCD, CMD_EDITRCD, CMD_DELRCD
          FindCrit = "ArtikelID>=" & GetParmInString(gsFormParm, 2)
          rs.Find (FindCrit)
          If (rs.RecordCount <> 0) And _
             rs.NoMatch Then
            rs.MoveFirst
          End If

    The WiseGuy
    I stuck my head out of the window and got arrested for mooning!

    This Post is sponsored by my PC: PIII900, 512MBDimm/133, Seagate 40GB/7200 ATA100, LiteOn 12x DVD, Lite-On 32x12x40 CDrw, Elsa Geforce2 Ultra 64MB incl tv-out, SoundBlaster Live 1024, Ilyama A702HT Vision Master Pro410 17".
    O/S: Windows XP Professional (dutch)
    Internet: Cable (1Mbit connection)

  2. #2
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    Does the find return a success value ?

    If so use that to determine whether to goto the first record or not.


    Vince

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  3. #3

    Thread Starter
    Lively Member WiseGuy's Avatar
    Join Date
    Apr 2002
    Location
    Zierikzee, The Netherlands
    Posts
    98
    The problem is that I don't completely understand the code especially this part:

    FindParm = GetParmInString(gsFormParm, 2)

    so maybe you can explain it a little bit for me?

    WiseGuy
    I stuck my head out of the window and got arrested for mooning!

    This Post is sponsored by my PC: PIII900, 512MBDimm/133, Seagate 40GB/7200 ATA100, LiteOn 12x DVD, Lite-On 32x12x40 CDrw, Elsa Geforce2 Ultra 64MB incl tv-out, SoundBlaster Live 1024, Ilyama A702HT Vision Master Pro410 17".
    O/S: Windows XP Professional (dutch)
    Internet: Cable (1Mbit connection)

  4. #4
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    Put the mouse over it, click the Right mouse button and select "definition".

    I don't know but it looks like a custom function.

    I can guess that it supplies (possibly) the second value of a list or the first to characters. Although it could be anything.

    It's more likely to return an id number though...


    Is this your project ? If the definition doesn't work try highlighting the word and pressing F1 (for help on it).

    Vince

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  5. #5
    Frenzied Member PilgrimPete's Avatar
    Join Date
    Feb 2002
    Posts
    1,313
    ADO recordsets don't have a NoMatch property. If the record isn't found, I think you end up at the end of the recordset. This code should do it:

    VB Code:
    1. Case CMD_ADDRCD, CMD_EDITRCD, CMD_DELRCD
    2.       FindCrit = "ArtikelID>=" & GetParmInString(gsFormParm, 2)
    3.       rs.Find (FindCrit)
    4.       'If (rs.RecordCount <> 0) And rs.NoMatch Then
    5.       If (rs.RecordCount <> 0) And rs.EOF Then
    6.         rs.MoveFirst
    7.       End If

  6. #6

    Thread Starter
    Lively Member WiseGuy's Avatar
    Join Date
    Apr 2002
    Location
    Zierikzee, The Netherlands
    Posts
    98
    Well I gues it works, becouse I'm not getting any errors but my datagrid isn't filled yet how can I enter some SQL stuff I thought it was somthing like this but it doesn't work:

    SQL="select * from artikelen"

    apperantly you need to declare 'SQL' but how, or is there a whole ather was to execute sql?
    btw the name of the datagrid is grdDataGrid

    many thanks in advance,


    The WiseGuy
    I stuck my head out of the window and got arrested for mooning!

    This Post is sponsored by my PC: PIII900, 512MBDimm/133, Seagate 40GB/7200 ATA100, LiteOn 12x DVD, Lite-On 32x12x40 CDrw, Elsa Geforce2 Ultra 64MB incl tv-out, SoundBlaster Live 1024, Ilyama A702HT Vision Master Pro410 17".
    O/S: Windows XP Professional (dutch)
    Internet: Cable (1Mbit connection)

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