What I would do if I were you is enumerate the Z-Buffers. Start checking if it supports the lowest all the way to the highest. Here's what Jack Hoxley did on DirectX4VB:

VB Code:
  1. If D3D.CheckDeviceFormat(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, DispMode.Format, D3DUSAGE_DEPTHSTENCIL, _
  2.         D3DRTYPE_SURFACE, D3DFMT_D16) = D3D_OK Then
  3.     Debug.Print "16 bit Z-Buffers are supported (D3DFMT_D16)"
  4. End If
  5.  
  6. If D3D.CheckDeviceFormat(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, DispMode.Format, D3DUSAGE_DEPTHSTENCIL, _
  7.         D3DRTYPE_SURFACE, D3DFMT_D16_LOCKABLE) = D3D_OK Then
  8.     Debug.Print "Lockable 16 bit Z-Buffers are supported (D3DFMT_D16_LOCKABLE)"
  9. End If
  10.  
  11. If D3D.CheckDeviceFormat(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, DispMode.Format, D3DUSAGE_DEPTHSTENCIL, _
  12.         D3DRTYPE_SURFACE, D3DFMT_D24S8) = D3D_OK Then
  13.     Debug.Print "32 bit divided between 24 bit Depth and 8 bit stencil are supported (D3DFMT_D24S8)"
  14. End If
  15.  
  16. If D3D.CheckDeviceFormat(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, DispMode.Format, D3DUSAGE_DEPTHSTENCIL, _
  17.         D3DRTYPE_SURFACE, D3DFMT_D24X4S4) = D3D_OK Then
  18.     Debug.Print "32 bit divided between 24 bit depth, 4 bit stencil and 4 bit unused (D3DFMT_D24X4S4)"
  19. End If
  20.  
  21. If D3D.CheckDeviceFormat(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, DispMode.Format, D3DUSAGE_DEPTHSTENCIL, _
  22.         D3DRTYPE_SURFACE, D3DFMT_D24X8) = D3D_OK Then
  23.     Debug.Print "24 bit Z-Buffer supported (D3DFMT_D24X8)"
  24. End If
  25.  
  26. If D3D.CheckDeviceFormat(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, DispMode.Format, D3DUSAGE_DEPTHSTENCIL, _
  27.         D3DRTYPE_SURFACE, D3DFMT_D32) = D3D_OK Then
  28.     Debug.Print "Pure 32 bit Z-buffer supported (D3DFMT_D32)"
  29. End If

Comes in handy. It helps my DirectX8 programs become more compatible with the various video cards out there and uses the most precise Z Buffer available. If you are using C++ (I bet you are), converting this snippet of code should be no problem.