Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. COM
  4. Custom OLEDB Provider

Custom OLEDB Provider

Scheduled Pinned Locked Moved COM
data-structureshelp
3 Posts 1 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Here we have a Custom OLEDB provider. We have problems dealing with the null values. The OLEDB provider is in VC. Here we get the records as an variant array and then moving it to a stream object and then assigning it to a BSTR pointer. We are reading that as an ADO recordset from VB. All the values are ok in VB. But when we come across null values, we are not able to process it properly. When we write NULL to the stream object (which is bytes), we are reading it as 0 in the VB recordset.(since in vc NULL has a value 0). So i need to read that value as null in the VB. In VC i tried writing VT_NULL and VT_EMPTY. But i could not read that as null in VB. if i use the isnull(fieldname) , i need to get the result as true if the value is null. I dont know how the null value is treated internally. We use this OLEDB provider not only from VB, we use even from Crystal reports for reports. So can anybody please let me know how do it or let me know any source where i can get the help from.

    L 2 Replies Last reply
    0
    • L Lost User

      Here we have a Custom OLEDB provider. We have problems dealing with the null values. The OLEDB provider is in VC. Here we get the records as an variant array and then moving it to a stream object and then assigning it to a BSTR pointer. We are reading that as an ADO recordset from VB. All the values are ok in VB. But when we come across null values, we are not able to process it properly. When we write NULL to the stream object (which is bytes), we are reading it as 0 in the VB recordset.(since in vc NULL has a value 0). So i need to read that value as null in the VB. In VC i tried writing VT_NULL and VT_EMPTY. But i could not read that as null in VB. if i use the isnull(fieldname) , i need to get the result as true if the value is null. I dont know how the null value is treated internally. We use this OLEDB provider not only from VB, we use even from Crystal reports for reports. So can anybody please let me know how do it or let me know any source where i can get the help from.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Hi, I have Q concerning ADO/OLEDB. I am writing an application which has to access MS-Access databases selected at runtime by the user thru a file open dialog, the format of the data bases is same but the databases may be located in different places. 1. Can I use ADO/OLEDB to open these DB's when a path is specified ( This capability like that of DAO, the path can be spec and opened ) 2. Or do i need the DSN and not specify the actual location so that the DSN will ask the user to locate the DB. (Actually here the application will use ODBC again when i want to use ADO) Since you are already working in OLEDB I hope you can help me in this context. Any suggestions or awnsers will be helpful.

      1 Reply Last reply
      0
      • L Lost User

        Here we have a Custom OLEDB provider. We have problems dealing with the null values. The OLEDB provider is in VC. Here we get the records as an variant array and then moving it to a stream object and then assigning it to a BSTR pointer. We are reading that as an ADO recordset from VB. All the values are ok in VB. But when we come across null values, we are not able to process it properly. When we write NULL to the stream object (which is bytes), we are reading it as 0 in the VB recordset.(since in vc NULL has a value 0). So i need to read that value as null in the VB. In VC i tried writing VT_NULL and VT_EMPTY. But i could not read that as null in VB. if i use the isnull(fieldname) , i need to get the result as true if the value is null. I dont know how the null value is treated internally. We use this OLEDB provider not only from VB, we use even from Crystal reports for reports. So can anybody please let me know how do it or let me know any source where i can get the help from.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Do you set the DBSTATUS_S_ISNULL in the status field for the accessor in your custom OLEDB provider??? I guess that is why VB does not cosider it as NULL properly.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups