1 | /********************************************************************* |
2 | * |
3 | * This is based on code created by Peter Harvey, |
4 | * (pharvey@codebydesign.com). |
5 | * |
6 | * Modified and extended by Nick Gorham |
7 | * (nick@lurcher.org). |
8 | * |
9 | * Any bugs or problems should be considered the fault of Nick and not |
10 | * Peter. |
11 | * |
12 | * copyright (c) 1999 Nick Gorham |
13 | * |
14 | * This library is free software; you can redistribute it and/or |
15 | * modify it under the terms of the GNU Lesser General Public |
16 | * License as published by the Free Software Foundation; either |
17 | * version 2 of the License, or (at your option) any later version. |
18 | * |
19 | * This library is distributed in the hope that it will be useful, |
20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
22 | * Lesser General Public License for more details. |
23 | * |
24 | * You should have received a copy of the GNU Lesser General Public |
25 | * License along with this library; if not, write to the Free Software |
26 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
27 | * |
28 | ********************************************************************** |
29 | * |
30 | * $Id: SQLAllocHandleStd.c,v 1.2 2009/02/18 17:59:08 lurcher Exp $ |
31 | * |
32 | * $Log: SQLAllocHandleStd.c,v $ |
33 | * Revision 1.2 2009/02/18 17:59:08 lurcher |
34 | * Shift to using config.h, the compile lines were making it hard to spot warnings |
35 | * |
36 | * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher |
37 | * |
38 | * First upload to SourceForge |
39 | * |
40 | * Revision 1.1.1.1 2000/09/04 16:42:52 nick |
41 | * Imported Sources |
42 | * |
43 | * Revision 1.4 1999/07/07 18:51:54 ngorham |
44 | * |
45 | * Add missing '*' |
46 | * |
47 | * Revision 1.3 1999/07/04 21:05:06 ngorham |
48 | * |
49 | * Add LGPL Headers to code |
50 | * |
51 | * Revision 1.2 1999/06/21 19:59:04 ngorham |
52 | * |
53 | * Fix bug in SQLAllocHandleStd.c, the wrong handle was being used to |
54 | * return the allocated env handle |
55 | * |
56 | * Revision 1.1.1.1 1999/05/29 13:41:05 sShandyb |
57 | * first go at it |
58 | * |
59 | * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey |
60 | * Imported sources |
61 | * |
62 | * Revision 1.2 1999/05/09 23:27:11 nick |
63 | * All the API done now |
64 | * |
65 | * Revision 1.1 1999/04/25 23:02:41 nick |
66 | * Initial revision |
67 | * |
68 | * |
69 | **********************************************************************/ |
70 | |
71 | #include <config.h> |
72 | #include "drivermanager.h" |
73 | |
74 | static char const rcsid[]= "$RCSfile: SQLAllocHandleStd.c,v $ $Revision: 1.2 $" ; |
75 | |
76 | SQLRETURN SQLAllocHandleStd( |
77 | SQLSMALLINT handle_type, |
78 | SQLHANDLE input_handle, |
79 | SQLHANDLE *output_handle ) |
80 | { |
81 | SQLRETURN ret; |
82 | |
83 | ret = __SQLAllocHandle( handle_type, |
84 | input_handle, |
85 | output_handle, |
86 | 0 ); |
87 | |
88 | if ( handle_type == SQL_HANDLE_ENV && |
89 | SQL_SUCCEEDED( ret )) |
90 | { |
91 | DMHENV environment = (DMHENV) *output_handle; |
92 | |
93 | environment -> requested_version = SQL_OV_ODBC3; |
94 | environment -> version_set = 1; |
95 | } |
96 | |
97 | return ret; |
98 | } |
99 | |