Received: from localhost (unknown [200.46.204.184]) by developer.postgresql.org (Postfix) with ESMTP id C94FA2E0054 for ; Tue, 1 Apr 2008 17:04:09 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 38317-07 for ; Tue, 1 Apr 2008 17:03:59 -0300 (ADT) X-Greylist: delayed 00:07:19.624307 by SQLgrey-1.7.5 Received: from smtpout06.prod.mesa1.secureserver.net (smtpout06-04.prod.mesa1.secureserver.net [64.202.165.227]) by developer.postgresql.org (Postfix) with SMTP id 54F1D2E004A for ; Tue, 1 Apr 2008 17:04:02 -0300 (ADT) Received: (qmail 31186 invoked from network); 1 Apr 2008 19:56:38 -0000 Received: from unknown (70.189.153.199) by smtpout06-04.prod.mesa1.secureserver.net (64.202.165.227) with ESMTP; 01 Apr 2008 19:56:38 -0000 From: "Charles S. Henkel" To: Subject: VS2008: Simple DataGridView not populating Date: Tue, 1 Apr 2008 12:56:36 -0700 Organization: Henkel Technical Computing, LLC Message-ID: <003301c89432$7eee4800$7ccad800$@com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0034_01C893F7.D28F7000" X-Mailer: Microsoft Office Outlook 12.0 thread-index: AciUMn3485Q0cT5KQQez/oU//290ag== Content-Language: en-us X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200804/4 X-Sequence-Number: 9467 This is a multipart message in MIME format. ------=_NextPart_000_0034_01C893F7.D28F7000 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Context: Windows Vista x64 PostgreSQL 8.3 (server on localhost) psql-obdc v8.03.01 Visual Studio 2008 (VS2008) Problem: I created a System DSN using the Data Sources (ODBC) administration tool located in \SysWOW64\odbcad32.exe. Note that this is *not* the same one you get from Control Panel ->Administrative Tools (that one is in /system32 and can apparently only manage 64 bit DSNs). Test successful. In VS2008, add new Data Source picking up one table from the DSN just created. On Data Sources tab, can rightclick the table and "Preview Data"...works fine in the IDE, successfully retrieving data from the database. Create a trivial Windows Forms Application with a DataGridView [DGV] control. No code-behind...just connect the DGV Data Source to the DSN table. Run the application...no data in DGV. Do exact same thing except with Northwind DSN (sample SQL Server database, not using PostgreSQL or psql-odbc)...run app...DGV populates just fine. Analysis: Enabling mylog in psql-odbc doesn't give much information. If I log the VS2008 IDE interaction with the DSN (e.g., when using "Preview Data")...it all looks good. If I compile the app and execute it with mylog enabled...nothing in the log file except the intialization from turning on logging. That is, the app never finds the DSN, and in fact gives an error to that effect: [ERROR] [IM002] [Microsoft] [ODBC Driver Manager] Data source name not found and no default driver specified. So it appears that this may be an x64 issue...The application can't find the DSN probably because there is no entry for it in HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI...instead the entry is in the redirected key HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI but it's not getting redirected there. I can't understand why the VS2008 IDE can interact with the DSN just fine, but the simple app can't find it. Perhaps there's a "target platform" I have to specify? Any ideas? Charles S. Henkel Henkel Technical Computing, LLC 9917 Laurel Springs Ave Las Vegas, NV 89134 ------=_NextPart_000_0034_01C893F7.D28F7000 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Context:

 

Windows Vista x64

PostgreSQL 8.3 (server on localhost)

psql-obdc v8.03.01

Visual Studio 2008 (VS2008)

 

Problem:

 

I created a System DSN using the Data Sources (ODBC) administration tool = located in <system>\SysWOW64\odbcad32.exe. Note that this is *not* = the same one you get from Control Panel ->Administrative Tools (that one = is in <system>/system32 and can apparently only manage 64 bit DSNs). = Test successful.

 

In VS2008, add new Data Source picking up one table from the DSN just = created.  On Data Sources tab, can rightclick the table and "Preview = Data"...works fine in the IDE, successfully retrieving data from the = database.

 

Create a trivial Windows Forms Application with a DataGridView [DGV] control. = No code-behind...just connect the DGV Data Source to the DSN table. Run the application...no data in DGV.

 

Do exact same thing except with Northwind DSN (sample SQL Server database, = not using PostgreSQL or psql-odbc)...run app...DGV populates just = fine.

 

Analysis:<= /o:p>

 

Enabling mylog in psql-odbc doesn't give much information. If I log the VS2008 = IDE interaction with the DSN (e.g., when using "Preview = Data")...it all looks good.

 

If I compile the app and execute it with mylog enabled...nothing in the log = file except the intialization from turning on logging. That is, the app never = finds the DSN, and in fact gives an error to that = effect:

 

[ERROR] [IM002] [Microsoft] [ODBC Driver Manager] Data source name not found and = no default driver specified.

 

So it appears that this may be an x64 issue...The application can't find = the DSN probably because there is no entry for it in = HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI...instead the entry is in the redirected key = HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI but it's not getting redirected there.

 

I can't understand why the VS2008 IDE can interact with the DSN just fine, = but the simple app can't find it. Perhaps there's a "target = platform" I have to specify? Any ideas?

 

 

Charles S. Henkel

Henkel Technical Computing, LLC

9917 Laurel Springs Ave

Las Vegas, NV  89134

 

------=_NextPart_000_0034_01C893F7.D28F7000--