Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle Release Number CLient Vs. Database

Re: Oracle Release Number CLient Vs. Database

From: Rauf Sarwar <rs_arwar_at_hotmail.com>
Date: 18 May 2005 15:41:52 -0700
Message-ID: <1116456112.870747.178740@g44g2000cwa.googlegroups.com>

Nicolas Bronke wrote:
> >> >> To get the database version use
> >> >>
> >> >> select * from v$version
> >> >>
> >> >> But how can I identify the client version?
> >> >>
> >> >> Is there a way on database side or does I have to use an API
> > function
> >> > which
> >> >> I can implement with delphi?
>
> > 2) Use version.dll Windows API to get file version of
oraclient*.dll OR
> > oci.dll.
> >
> Hm. OCI.DLL has been my first idea, but Oracle does not maintain the
release
> number. I get 0.0.0.0 even if I use Windows Properties.But they have
> implemented Dateiversion. Now I am searching for reading this. But
perhaps
> this does not work on each windows with different languages.
>
> Thanks and regards
> Nicolas

It does show the FileVersion if you right click/properties... you have to look for it under "Version" tab and "Other File Information" -> "File Version" (On XP).

You can use oci.dll but I am not sure if this file gets installed unless you install OCI. I don't have a pure client install to check it.
>From 8i onwards, you will have atleast oraclient*.dll present with any
install. Prior to 8i you could look for ora80*.dll (8.0.x) or ora73.dll (7.3.x).

Here is the sample code to get file version on Windows. You can switch between FileVersion or ProductVersion.

void GetFileVersion (char * pszAppName, // file

                     char * pszVerBuff, // receives version
                     int     iVerBuffLen, // size of buffer
                     char * pszLangBuff, // receives language
                     int iLangBuffLen) // size of buffer
{

   DWORD dwScratch;
   DWORD * pdwLangChar;
   DWORD dwInfSize ;
   UINT uSize;
   BYTE * pbyInfBuff;
   char szVersion [32];
   char szResource [80];
   char * pszVersion = szVersion;

   dwInfSize = GetFileVersionInfoSize (pszAppName, &dwScratch);

   if (dwInfSize)
   {

      pbyInfBuff = new BYTE [dwInfSize];
      memset (pbyInfBuff, 0, dwInfSize);
      if (pbyInfBuff)
      {
         if (GetFileVersionInfo (pszAppName, 0, dwInfSize, pbyInfBuff))
         {
            if (VerQueryValue (pbyInfBuff,
                               "\\VarFileInfo\\Translation",
                               (void**)(&pdwLangChar),
                               &uSize))
            {
               if (VerLanguageName (LOWORD (*pdwLangChar),
                                    szResource,
                                    sizeof(szResource)))
               {
                  strncpy (pszLangBuff, szResource, iLangBuffLen);
               }
               wsprintf (szResource,
"\\StringFileInfo\\%04X%04X\\FileVersion",
                         LOWORD (*pdwLangChar), HIWORD (*pdwLangChar));

               if (VerQueryValue (pbyInfBuff,
                                  szResource,
                                  (void**)(&pszVersion),
                                  &uSize))
               {
                  strncpy (pszVerBuff, pszVersion, iVerBuffLen-1);
               }
            }
         }
         delete [] pbyInfBuff;
      }

   }
}

Regards
/Rauf Received on Wed May 18 2005 - 17:41:52 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US