VB 6.0 and SQL query retrieval

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • NasirMunir
    New Member
    • Jun 2007
    • 27

    VB 6.0 and SQL query retrieval

    I am trying to retrieve rows from an access database, the table name is FE_LOG_DATA. I can see the rows being returned when I use the access query mode in access, however when I try to do that with VB code I am having troubles.
    The query I am using is:

    Code:
    SQLstr = "Select * From FE_LOG_DATA Where (IS_IMPORTED= 0 Or IS_IMPORTED Is Null) And IS_CREATED = False"
    If I dont use IS_IMPORTED then I am fine, but when I try to use that part I am getting zero rows returned. (the recordset.count shows zero in the debug mode).
    I have tried breaking the query by taking one at a time. IS_IMPORTED = False works, but IS_IMPORTED = 0 does not. Same is the case with IS_IMPORTED = Null, it does not work in the VB code. Works fine in the access query.
    Need some help here,
    Thanks
  • NasirMunir
    New Member
    • Jun 2007
    • 27

    #2
    Originally posted by NasirMunir
    I am trying to retrieve rows from an access database, the table name is FE_LOG_DATA. I can see the rows being returned when I use the access query mode in access, however when I try to do that with VB code I am having troubles.
    The query I am using is:

    Code:
    SQLstr = "Select * From FE_LOG_DATA Where (IS_IMPORTED= 0 Or IS_IMPORTED Is Null) And IS_CREATED = False"
    If I dont use IS_IMPORTED then I am fine, but when I try to use that part I am getting zero rows returned. (the recordset.count shows zero in the debug mode).
    I have tried breaking the query by taking one at a time. IS_IMPORTED = False works, but IS_IMPORTED = 0 does not. Same is the case with IS_IMPORTED = Null, it does not work in the VB code. Works fine in the access query.
    Need some help here,
    Thanks
    I forgot to list a line which might be the problem (I don't understand the objects used to open the recordset.
    Code:
    recordset.Open SQLstr, strCnn, adOpenStatic, adLockOptimistic, adCmdText

    Comment

    Working...