X-Original-To: pgsql-odbc@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 6E3A84758C9 for ; Thu, 6 Feb 2003 23:15:12 -0500 (EST) Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34]) by postgresql.org (Postfix) with SMTP id 3A433475458 for ; Thu, 6 Feb 2003 23:15:11 -0500 (EST) Received: (qmail 13804 invoked from network); 7 Feb 2003 04:15:15 -0000 Received: from unknown (HELO viscomail.tpf.co.jp) (100.0.0.108) by sd2.tpf-fw-c.co.jp with SMTP; 7 Feb 2003 04:15:15 -0000 Received: from tpf.co.jp (3dgateway1 [126.0.1.60]) by viscomail.tpf.co.jp (8.8.8+Sun/8.8.8) with ESMTP id NAA06753; Fri, 7 Feb 2003 13:15:14 +0900 (JST) Message-ID: <3E433368.FCE7D528@tpf.co.jp> Date: Fri, 07 Feb 2003 13:17:44 +0900 From: Hiroshi Inoue X-Mailer: Mozilla 4.73 [ja] (Windows NT 5.0; U) X-Accept-Language: ja MIME-Version: 1.0 To: Andreas Pflug Cc: pgsql-odbc@postgresql.org Subject: Re: Insert with bound columns References: <3E42AA74.9090606@web.de> <3E42DA23.1060405@web.de> Content-Type: text/plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/39 X-Sequence-Number: 2657 Andreas Pflug wrote: > > 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). I can insert a '' or NULL using ADO.Parameter in VB. > 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. The psqlodbc driver couldn't determine the parameter type unless the upper application specifies it explicitly. > 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. Maybe SQLDescribeParam should be supported though I'm not sure. regards, Hiroshi Inoue http://www.geocities.jp/inocchichichi/psqlodbc/