Re: Variant datatype not supported?





Wes Clark wrote:

I'm trying to write a method that will tell me what version, 8 or 9, I'm running on. When I connect to 2000, I use the old driver. When I connect to 2005, I use the new driver. I first used the DatabaseMetaData.getDatabaseMajorVersion() method, but it is not supported in the old driver. Then I used getDatabaseProductVersion, which returns "Microsoft SQL Server 2000 - 8.00.760 (Intel X86) Dec 17 2002 14:22:05 Copyright (c) 1988-2003 Microsoft Corporation
Developer Edition on Windows NT 5.1 (Build 2600: Service Pack 2)" in the old version, and "9.00.1399" in the new. So I noticed if I selected SERVERPROPERTY('ProductVersion'), I got 8.00.760 in the old version, and 9.00.1399.06 in the new version. Perfect. The query works in 2000, but in 2005 I get "com.microsoft.sqlserver.jdbc.SQLServerException: Data type 'variant' not supported".

Hi Wess. Try this:

"select convert(varchar(100), SERVERPROPERTY('ProductVersion'))"

HTH,
Joe Weinstein at BEA Systems

.



Relevant Pages

  • Re: [SLE] K8V?
    ... would finally just sit there w/the status light flashing, ... What I did was change from the 'recommended' driver to another driver. ... HTH... ... Linux user# 313696 ...
    (SuSE)
  • Re: Page Numbers Disappear in Print Preview
    ... driver - especially so if you're running 2007 on Vista. ... HTH |:>) ... Bob Jones ...
    (microsoft.public.word.pagelayout)
  • Re: HP deskjet
    ... During the "setup" script I chose the "hpijs" driver. ... HTH, ... Kevin Kinsey ...
    (freebsd-newbies)
  • Re: iAnywhere JDBC driver
    ... typically a program needs the driver, user, password and URL. ... Try giving it the URL for the driver you want... ... Joe Weinstein at BEA Systems ...
    (comp.databases.sybase)
  • Re: SOS! How to add new record to many to many relationship using a fo
    ... Amy ... I can add a driver to the drivers ... Then, in the form's unload event, ... > HTH; ...
    (microsoft.public.access.forms)

Loading