Unix Technical Forum

NewBie, SQLAllocHandle only works on Win2003Server.

This is a discussion on NewBie, SQLAllocHandle only works on Win2003Server. within the MS SQL ODBC forums, part of the Microsoft SQL Server category; --> Hi, I just did a test, this code returns 1 on a windows2003 Server system, and my import works ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > MS SQL ODBC

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 08:59 PM
Rob Dob
 
Posts: n/a
Default NewBie, SQLAllocHandle only works on Win2003Server.

Hi,

I just did a test, this code returns 1 on a windows2003 Server system, and
my import works fine, however if I run this same code on a WinXP, Pro or XP
Media it then returns 1 and the import does NOT work...

Please any suggestions would be creatly appreciated..

where should I start looking.?

retcode = 1 when running on Server 2003
retcode = 0 when running on WinXP Pro or WinXP Media


SQLHENV henv = SQL_NULL_HENV;
HDBC hdbc1 = SQL_NULL_HDBC;
RETCODE retcode;
SDWORD cRows;
// Allocate the ODBC environment and save handle.
retcode = SQLAllocHandle (SQL_HANDLE_ENV, SQL_NULL_HANDLE, &henv);
if ( (retcode != SUCCEED) )
return;
}




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 09:00 PM
Warren Read
 
Posts: n/a
Default RE: NewBie, SQLAllocHandle only works on Win2003Server.

This is pretty weird. The retcode should be '0' regardless of the OS.

Also, I don't see you returning a value at all. Your function just executes
a 'return;' . Are you sure it's the ODBC call that's affecting your return
value?


--------------------
| From: "Rob Dob" <robdob20012002@yahoo.com>
| Subject: NewBie, SQLAllocHandle only works on Win2003Server.
| Date: Sun, 30 Oct 2005 17:35:40 -0500
| Lines: 27
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| X-RFC2646: Format=Flowed; Original
| Message-ID: <Oni6DJa3FHA.2196@tk2msftngp13.phx.gbl>
| Newsgroups:
microsoft.public.sqlserver.msde,microsoft.public.s qlserver.odbc,microsoft.pu
blic.vc.mfc
| NNTP-Posting-Host: hse-ottawa-ppp238729.sympatico.ca 64.230.82.20
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msft ngp13.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.odbc:2966
microsoft.public.vc.mfc:44999 microsoft.public.sqlserver.msde:8861
| X-Tomcat-NG: microsoft.public.sqlserver.odbc
|
| Hi,
|
| I just did a test, this code returns 1 on a windows2003 Server system,
and
| my import works fine, however if I run this same code on a WinXP, Pro or
XP
| Media it then returns 1 and the import does NOT work...
|
| Please any suggestions would be creatly appreciated..
|
| where should I start looking.?
|
| retcode = 1 when running on Server 2003
| retcode = 0 when running on WinXP Pro or WinXP Media
|
|
| SQLHENV henv = SQL_NULL_HENV;
| HDBC hdbc1 = SQL_NULL_HDBC;
| RETCODE retcode;
| SDWORD cRows;
| // Allocate the ODBC environment and save handle.
| retcode = SQLAllocHandle (SQL_HANDLE_ENV, SQL_NULL_HANDLE, &henv);
| if ( (retcode != SUCCEED) )
| return;
| }
|
|
|
|
|

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-27-2008, 09:02 PM
Rob Dob
 
Posts: n/a
Default Re: NewBie, SQLAllocHandle only works on Win2003Server.

Hi,

actually it turned out to be a wrong dll on the system, SQLSrv32.dll

thanks.

"Warren Read" <wread@online.microsoft.com> wrote in message
news:7xqDrCn3FHA.3220@TK2MSFTNGXA01.phx.gbl...
> This is pretty weird. The retcode should be '0' regardless of the OS.
>
> Also, I don't see you returning a value at all. Your function just
> executes
> a 'return;' . Are you sure it's the ODBC call that's affecting your return
> value?
>
>
> --------------------
> | From: "Rob Dob" <robdob20012002@yahoo.com>
> | Subject: NewBie, SQLAllocHandle only works on Win2003Server.
> | Date: Sun, 30 Oct 2005 17:35:40 -0500
> | Lines: 27
> | X-Priority: 3
> | X-MSMail-Priority: Normal
> | X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
> | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
> | X-RFC2646: Format=Flowed; Original
> | Message-ID: <Oni6DJa3FHA.2196@tk2msftngp13.phx.gbl>
> | Newsgroups:
> microsoft.public.sqlserver.msde,microsoft.public.s qlserver.odbc,microsoft.pu
> blic.vc.mfc
> | NNTP-Posting-Host: hse-ottawa-ppp238729.sympatico.ca 64.230.82.20
> | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msft ngp13.phx.gbl
> | Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.odbc:2966
> microsoft.public.vc.mfc:44999 microsoft.public.sqlserver.msde:8861
> | X-Tomcat-NG: microsoft.public.sqlserver.odbc
> |
> | Hi,
> |
> | I just did a test, this code returns 1 on a windows2003 Server system,
> and
> | my import works fine, however if I run this same code on a WinXP, Pro
> or
> XP
> | Media it then returns 1 and the import does NOT work...
> |
> | Please any suggestions would be creatly appreciated..
> |
> | where should I start looking.?
> |
> | retcode = 1 when running on Server 2003
> | retcode = 0 when running on WinXP Pro or WinXP Media
> |
> |
> | SQLHENV henv = SQL_NULL_HENV;
> | HDBC hdbc1 = SQL_NULL_HDBC;
> | RETCODE retcode;
> | SDWORD cRows;
> | // Allocate the ODBC environment and save handle.
> | retcode = SQLAllocHandle (SQL_HANDLE_ENV, SQL_NULL_HANDLE, &henv);
> | if ( (retcode != SUCCEED) )
> | return;
> | }
> |
> |
> |
> |
> |
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:56 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com