X-Original-To: pgsql-odbc@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id CCC66476009 for ; Thu, 6 Feb 2003 17:43:45 -0500 (EST) Received: from smtp.web.de (smtp02.web.de [217.72.192.151]) by postgresql.org (Postfix) with ESMTP id 9EA39476317 for ; Thu, 6 Feb 2003 16:56:49 -0500 (EST) Received: from p508189c6.dip0.t-ipconnect.de ([80.129.137.198] helo=web.de) by smtp.web.de with asmtp (WEB.DE(Exim) 4.93 #1) id 18gu0o-0001rs-00 for pgsql-odbc@postgresql.org; Thu, 06 Feb 2003 22:56:50 +0100 Message-ID: <3E42DA23.1060405@web.de> Date: Thu, 06 Feb 2003 22:56:51 +0100 From: Andreas Pflug User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3a) Gecko/20021212 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-odbc@postgresql.org Subject: Re: Insert with bound columns References: <3E42AA74.9090606@web.de> In-Reply-To: <3E42AA74.9090606@web.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/38 X-Sequence-Number: 2656 After experimenting heavily, I found out some more. MSDASQL doesn't like a NULL-pointer as string in the buffer to be written. Instead, a SysAllocString(L"") is needed. This is acceptable, if an zero length string should be inserted. If the status field of the buffer ist not set to DBSTATUS_S_OK indicating valid data to be written, but to DBSTATUS_S_ISNULL for a NULL to be inserted, MSDASQL will fail with "Parameter type cannot be determined for at leas one variant parameter". Actually, it's no variant given, but a DBTYPE_BSTR, and this information is put correctly into the DBBINDING structure. Still, I believe ADO users should be unable to insert a NULL string into a VARCHAR column (if not omitted in the query). The same (OLEDB side) code works with SQLSRV32, and MSDASQL blows as soon as it gets to know the number of parameters, so it seems that for SQLSRV32 MSDASQL can determine the parameter type from the SQL server driver, but not with PostgreSQL. Does this switch on a light for anybody, saying "ah now I know what SQLxxyy is for"? If pointed towards some topic, I could try to implement it. Regards, Andreas