X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 2EEB5DBDF4 for ; Fri, 25 Nov 2005 15:27:53 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 73306-06 for ; Fri, 25 Nov 2005 19:27:49 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from Mail2.KONTENT.De (mail2.kontent.de [81.88.34.59]) by svr1.postgresql.org (Postfix) with ESMTP id 5E2AFDBDF8 for ; Fri, 25 Nov 2005 15:27:45 -0400 (AST) Received: from jedi.behrens.de (p5085B553.dip0.t-ipconnect.de [80.133.181.83]) by Mail2.KONTENT.De (Postfix) with ESMTP id 9720938808C; Fri, 25 Nov 2005 20:27:39 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by jedi.behrens.de (Postfix) with ESMTP id DA0431AE4F; Fri, 25 Nov 2005 20:27:38 +0100 (CET) Received: from jedi.behrens.de ([127.0.0.1]) by localhost (jedi [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 26960-01; Fri, 25 Nov 2005 20:27:38 +0100 (CET) Received: from anakin (anakin.behrens.de [192.168.150.240]) by jedi.behrens.de (Postfix) with ESMTP id A1EFE1A6DD; Fri, 25 Nov 2005 20:27:38 +0100 (CET) From: lothar.behrens@lollisoft.de To: "Dave Page" Date: Fri, 25 Nov 2005 20:27:38 +0100 MIME-Version: 1.0 Subject: Re: VARCHAR, CHAR types changed ? Cc: pgsql-odbc@postgresql.org Message-ID: <438773BA.28272.54410F@localhost> In-reply-to: X-mailer: Pegasus Mail for Windows (4.21c, DE v4.21c R1a) Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: Quoted-printable Content-description: Mail message body X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.55 required=5 tests=[NO_REAL_NAME=0.55] X-Spam-Score: 0.55 X-Spam-Level: X-Archive-Number: 200511/213 X-Sequence-Number: 6449 Am 25 Nov 2005 um 14:35 hat Dave Page geschrieben: My query function first calls SQLExecDirect(hstmt, _query, SQL_NTS); I have changed this to do exactly the same as your sample and pass the len= gth of the string. No way. As you have put together a complete sample application, I have tried this = compiled with Open Watcom 1.3 and MS Visual C++ 6.0. Both do the same. They crash i= nside the call to SQLExecDirect. My registered ODBC driver DLL is 335.872 bytes and from 11.11.2005 08:29:4= 2 With Open Watcom debugger, I found the crash inside ConfigDSN. Is there an= y change in the ordinals inside the PSQLODBCA.dll ? The same happens, if I rename the DLL filenames :-) Regards Lothar > > > > -----Original Message----- > > From: pgsql-odbc-owner@postgresql.org > > [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of > > lothar.behrens@lollisoft.de > > Sent: 25 November 2005 13:21 > > To: pgsql-odbc@postgresql.org > > Subject: Re: [ODBC] VARCHAR, CHAR types changed ? > > > > I have tried to use ANSI driver. It crashes :-( > > > > My code to connect and setup a statement looks like this: > > > > > > > > The code is simple console based, but my database classes encapsulate > > all ODBC > > CLI calls. The internal statement handle is reused. The table get's > > created and filled. > > > > Any ideas ? > > Well, I've tried the code below which is roughly as close as I can get > to what you posted (not having your query class), and it SQLExecDirect's > just fine here. Any thoughts on what might be significantly different > here?: > > Regards, Dave. > > #include > #include > #include > > > int main(void) > { > HENV henv =3D NULL; // E= nv > Handle from SQLAllocEnv() > HDBC hdbc =3D NULL; // > Connection handle > HSTMT hstmt =3D NULL; // > Statement handle > UCHAR DSN[SQL_MAX_DSN_LENGTH] =3D "ansi"; // Da= ta > Source Name buffer > UCHAR user[64] =3D "postgres"; // Us= er > ID buffer > UCHAR* passwd =3D NULL; // > Password buffer > > SQLAllocEnv (&henv); > > SQLAllocConnect (henv, &hdbc); > > SQLSetEnvAttr(henv, SQL_ATTR_ODBC_VERSION, (void*) SQL_OV_ODBC3, 0); > > SQLSetConnectAttr(hdbc, > SQL_ATTR_ODBC_CURSORS, > SQL_CUR_USE_IF_NEEDED, 0); > > SQLConnect(hdbc, DSN, SQL_NTS, > user, SQL_NTS, > passwd, SQL_NTS); > > SQLSetConnectOption(hdbc, SQL_AUTOCOMMIT, SQL_AUTOCOMMIT_ON); > > SQLAllocStmt (hdbc, &hstmt); > > SQLSetStmtOption(hstmt, SQL_ATTR_CONCURRENCY, SQL_CONCUR_ROWVER); > SQLSetStmtOption(hstmt, SQL_CURSOR_TYPE, SQL_CURSOR_KEYSET_DRIVEN); > > > > UCHAR buf1[] =3D "create table regressiontest (" > "test char(100) DEFAULT 'Nothing',\n" > "btest bool DEFAULT false, " > "btest1 bool DEFAULT false" > ");"; > UCHAR buf2[] =3D "insert into regressiontest (test) values('Nix')"; > UCHAR buf3[] =3D "insert into regressiontest (btest) values(true)"; > UCHAR buf4[] =3D "insert into regressiontest (btest1) values(true)"; > > > SQLExecDirect(hstmt, buf1, sizeof(buf1)); > SQLExecDirect(hstmt, buf2, sizeof(buf2)); > SQLExecDirect(hstmt, buf3, sizeof(buf3)); > SQLExecDirect(hstmt, buf4, sizeof(buf4)); > > // This statement crashes inside SQLExecDirect(...) > UCHAR buf5[] =3D "select test, btest, btest1 from regressiontest"; > SQLExecDirect(hstmt, buf5, sizeof(buf5)); > > // UCHAR buf6[] =3D "drop table regressiontest"; > // SQLExecDirect(hstmt, buf6, sizeof(buf6)); > > // Free the allocated statement handle > SQLFreeStmt (hstmt, SQL_DROP); > > // Free the allocated connection handle > SQLFreeConnect (hdbc); > > // Free the allocated ODBC environment handle > SQLFreeEnv (henv); > > return 0; > } > > -- Lothar Behrens | Rapid Prototyping ... Rosmarinstr 3 | 40235 D=FCsseldorf | www.lollisoft.de