pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amarsh M <amarshm@gmail.com>
To: pgsql-odbc@postgresql.org
Subject: MFC issues with ODBC
Date: Fri, 15 Jul 2005 18:10:22 -0500
Message-ID: <9ffd866c0507151610411bf275@mail.gmail.com> (raw)

Hello,

I have an issue with ODBC connectivity. I am using the latest version
of PostGreSQL  with VC++  and using  ODBC to connect. I use the MFC
object namely CRecordset to get the records from the DB, this code was
working great when it was intially written a couple of months ago. I
started to work on it again this week and the code doesnt work
anymore, esp the CRecordset::Open method fails.

A brief snippet of my code

recordptr=new CRecordset(this);
this->ExecuteSQL("insert into test values (3,'three');");
AfxMessageBox("Executed the statement");
ret=recordptr->Open(CRecordset::snapshot,SQL.Trim(),CRecordset::none);

In the above code the last line fails all others including executeSQL
on the CDatabase object work fine. Also it gives no error message it
just gives a blank message box.

Upon looking into the code I found the crash was happening  when it
was trying to get a record, specifically in MoveNext(); function
inside  dbcore.cpp (which is a MS class).

I cant make much of the log, but here is the actual failure part
"Select project name from master;" is the SQL statement I am trying to
execute and there is data in the table.

Thanks in advance

   a14-ea0	ENTER SQLPrepare 
		HSTMT               01742520
		UCHAR *             0x013BDA40 [      -3] "Select projectname from master;\ 0"
		SDWORD                    -3

     a14-ea0	ENTER SQLPrepare 
		HSTMT               01742520
		UCHAR *             0x00378E10 [      31] "Select projectname from master;"
		SDWORD                    31

     a14-ea0	EXIT  SQLPrepare  with return code 0 (SQL_SUCCESS)
		HSTMT               01742520
		UCHAR *             0x00378E10 [      31] "Select projectname from master;"
		SDWORD                    31

     a14-ea0	EXIT  SQLPrepare  with return code 0 (SQL_SUCCESS)
		HSTMT               01742520
		UCHAR *             0x013BDA40 [      -3] "Select projectname from master;\ 0"
		SDWORD                    -3

    a14-ea0	ENTER SQLExecute 
		HSTMT               01742520

    a14-ea0	ENTER SQLExecute 
		HSTMT               01742520

     a14-ea0	EXIT  SQLExecute  with return code 0 (SQL_SUCCESS)
		HSTMT               01742520

     a14-ea0	ENTER SQLNumResultCols 
		HSTMT               01742520
		SWORD *             0x0037E97E
     a14-ea0	EXIT  SQLNumResultCols  with return code 0 (SQL_SUCCESS)
		HSTMT               01742520
		SWORD *             0x0037E97E (1)

    a14-ea0	EXIT  SQLExecute  with return code 0 (SQL_SUCCESS)
		HSTMT               01742520

    a14-ea0	ENTER SQLNumResultCols 
		HSTMT               01742520
		SWORD *             0x013BD7B8

    a14-ea0	EXIT  SQLNumResultCols  with return code 0 (SQL_SUCCESS)
		HSTMT               01742520
		SWORD *             0x013BD7B8 (1)

     a14-ea0	ENTER SQLDescribeCol 
		HSTMT               01742520
		UWORD                        1 
		UCHAR *             0x013BDB48 
		SWORD                      256 
		SWORD *             0x0012EC3C
		SWORD *             0x013BDA98
		SQLULEN *           0x013BDA9C
		SWORD *             0x013BDAA0
		SWORD *             0x013BDAA2

    a14-ea0	EXIT  SQLDescribeCol  with return code 0 (SQL_SUCCESS)
		HSTMT               01742520
		UWORD                        1 
		UCHAR *             0x013BDB48 [      11] "projectname"
		SWORD                      256 
		SWORD *             0x0012EC3C (11)
		SWORD *             0x013BDA98 (-9)
		SQLULEN *           0x013BDA9C (200)
		SWORD *             0x013BDAA0 (0)
		SWORD *             0x013BDAA2 (1)

     a14-ea0	ENTER SQLExtendedFetch 
		HSTMT               01742520
		UWORD                        1 <SQL_FETCH_NEXT>
		SQLLEN                     1
		SQLULEN *           0x013BD840
		UWORD *             0x013B8E58

     a14-ea0	EXIT  SQLExtendedFetch  with return code -1 (SQL_ERROR)
		HSTMT               01742520
		UWORD                        1 <SQL_FETCH_NEXT>
		SQLLEN                     1
		SQLULEN *           0x013BD840
		UWORD *             0x013B8E58

    a14-ea0	ENTER SQLErrorW 
		HENV                01741540
		HDBC                017415E8
		HSTMT               01742520
		WCHAR *             0x0012E870 (NYI) 
 		SDWORD *            0x0012EB44
		WCHAR *             0x0012E470 
		SWORD                      511 
		SWORD *             0x0012E934
    a14-ea0	EXIT  SQLErrorW  with return code 100 (SQL_NO_DATA_FOUND)
		HENV                01741540
		HDBC                017415E8
		HSTMT               01742520
		WCHAR *             0x0012E870 (NYI) 
 		SDWORD *            0x0012EB44
		WCHAR *             0x0012E470 
		SWORD                      511 
		SWORD *             0x0012E934

     a14-ea0	ENTER SQLFreeStmt 
		HSTMT               01742520
		UWORD                        1 <SQL_DROP>



Message-ID: <9ffd866c0507151610411bf275@mail.gmail.com>
Permalink:  ../9ffd866c0507151610411bf275@mail.gmail.com/
Also on:    postgresql.org/message-id/9ffd866c0507151610411bf275@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: amarshm@gmail.com
  Subject: Re: MFC issues with ODBC
  In-Reply-To: <9ffd866c0507151610411bf275@mail.gmail.com>
  References: <9ffd866c0507151610411bf275@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox