check the field exist or not ?

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

    #1

    check the field exist or not ?

    pKcno = myReader.Item(" kcno") <--it will return error when the field
    "kcno" doesn't exist

    any method to check the field exist or not first , if not exist, I want to
    skip the above statement.

    Thanks


  • Hal Rosser

    #2
    Re: check the field exist or not ?


    "Agnes" <szesze@bbs.org .hkwrote in message
    news:ecMaKMrQIH A.4880@TK2MSFTN GP03.phx.gbl...
    pKcno = myReader.Item(" kcno") <--it will return error when the field
    "kcno" doesn't exist
    >
    any method to check the field exist or not first , if not exist, I want to
    skip the above statement.
    >
    Thanks
    Check if its nothing before using it.
    If myReader.Item(" kcno") is Nothing then
    '*** the field doesn't exist
    else
    ' do something creative with it
    End If


    Comment

    Working...