This is a multi-part message in MIME format.
------_=_NextPart_001_01C89436.C9A4F2C7
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
One question=2E If you are using VS 2008 and presumably =2ENET
Framework,=
=0D=0Awhy are you not using the PostgreSQL ADO=2ENET driver instead of
ODB=
C?=0D=0A =0D=0Ahttp://pgfoundry=2Eorg/projects/npgsql=0D=0A
=0D=0A =0D=0A=
=0D=0A________________________________=0D=0A=0D=0AFrom:
pgsql-odbc-owner@[EMAIL PROTECTED]
On Behalf
Of=
Charles S=2E Henkel=0D=0ASent: Tuesday, April 01, 2008 3:57 PM=0D=0ATo:
pg=
sql-odbc@[EMAIL PROTECTED]
[ODBC] VS2008: Simple DataGridView
=
not populating=0D=0A=0D=0A=0D=0A=0D=0AContext:=0D=0A=0D=0A
=0D=0A=0D=0AWind=
ows Vista x64=0D=0A=0D=0APostgreSQL 8=2E3 (server on
localhost)=0D=0A=0D=0A=
psql-obdc v8=2E03=2E01=0D=0A=0D=0AVisual Studio 2008 (VS2008)=0D=0A=0D=0A
=
=0D=0A=0D=0AProblem:=0D=0A=0D=0A =0D=0A=0D=0AI created a System DSN using
t=
he Data Sources (ODBC) administration tool=0D=0Alocated in
<system>\SysWOW6=
4\odbcad32=2Eexe=2E Note that this is *not* the=0D=0Asame one you get from
=
Control Panel ->Administrative Tools (that one is=0D=0Ain
<system>/system32=
and can apparently only manage 64 bit DSNs)=2E
Test=0D=0Asuccessful=2E=0D=
=0A=0D=0A =0D=0A=0D=0AIn VS2008, add new Data Source picking up one table
f=
rom the DSN just=0D=0Acreated=2E On Data Sources tab, can rightclick the
t=
able and "Preview=0D=0AData"=2E=2E=2Eworks fine in the IDE, successfully
re=
trieving data from the=0D=0Adatabase=2E=0D=0A=0D=0A =0D=0A=0D=0ACreate a
tr=
ivial Windows Forms Application with a DataGridView [DGV]=0D=0Acontrol=2E
N=
o code-behind=2E=2E=2Ejust connect the DGV Data Source to the
DSN=0D=0Atabl=
e=2E Run the application=2E=2E=2Eno data in DGV=2E=0D=0A=0D=0A
=0D=0A=0D=0A=
Do exact same thing except with Northwind DSN (sample SQL
Server=0D=0Adatab=
ase, not using PostgreSQL or psql-odbc)=2E=2E=2Erun app=2E=2E=2EDGV
populat=
es=0D=0Ajust fine=2E=0D=0A=0D=0A =0D=0A=0D=0AAnalysis:=0D=0A=0D=0A =0D=0A=
=0D=0AEnabling mylog in psql-odbc doesn't give much information=2E If I
log=
the=0D=0AVS2008 IDE interaction with the DSN (e=2Eg=2E, when using
"Previe=
w=0D=0AData")=2E=2E=2Eit all looks good=2E =0D=0A=0D=0A =0D=0A=0D=0AIf I
co=
mpile the app and execute it with mylog enabled=2E=2E=2Enothing in the=0D=
=0Alog file except the intialization from turning on logging=2E That is,
th=
e=0D=0Aapp never finds the DSN, and in fact gives an error to that
effect:=
=0D=0A=0D=0A =0D=0A=0D=0A[ERROR] [IM002] [Microsoft] [ODBC Driver Manager]
=
Data source name not=0D=0Afound and no default driver
specified=2E=0D=0A=0D=
=0A =0D=0A=0D=0ASo it appears that this may be an x64 issue=2E=2E=2EThe
app=
lication can't find=0D=0Athe DSN probably because there is no entry for it
=
in=0D=0AHKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC=2EINI=2E=2E=2Einstead the
ent=
ry is in the=0D=0Aredirected key
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\OD=
BC\ODBC=2EINI but=0D=0Ait's not getting redirected there=2E=0D=0A=0D=0A
=0D=
=0A=0D=0AI can't understand why the VS2008 IDE can interact with the DSN
ju=
st=0D=0Afine, but the simple app can't find it=2E Perhaps there's a
"target=
=0D=0Aplatform" I have to specify? Any ideas?=0D=0A=0D=0A =0D=0A=0D=0A
=0D=
=0A=0D=0ACharles S=2E Henkel=0D=0A=0D=0AHenkel Technical Computing,
LLC=0D=
=0A=0D=0A9917 Laurel Springs Ave=0D=0A=0D=0ALas Vegas, NV 89134=0D=0A=0D=
=0A
=0D=0A=0D=0A=0D=0A=0D=0A-----------------------------------------=0D=0A=
The substance of this message, including any attachments, may
be=0Aconfiden=
tial, legally privileged and/or exempt from disclosure=0Apursuant to
Massac=
husetts law=2E It is intended=0D=0Asolely for the addressee=2E If you
recei=
ved this in error, please=0Acontact the sender and delete the material
from=
any computer=2E=0D=0A
------_=_NextPart_001_01C89436.C9A4F2C7
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4=2E0
Transitional//EN">=0D=0A<HTML=
xmlns=3D"http://www=2Ew3=2Eorg/TR/REC-html40"
xmlns:v =3D
=0D=0A"urn:schem=
as-microsoft-com:vml" xmlns:o =3D
=0D=0A"urn:schemas-microsoft-com:office:o=
ffice" xmlns:w =3D =0D=0A"urn:schemas-microsoft-com:office:word" xmlns:m =
=3D
=0D=0A"http://schemas=2Emicrosoft=2Ecom/office/2004/12/omml"><HEAD>=0D=
=0A<META http-equiv=3DContent-Type content=3D"text/html;
charset=3Dus-ascii=
">=0D=0A<META content=3D"MSHTML 6=2E00=2E6000=2E16481"
name=3DGENERATOR>=0D=
=0A<STYLE>@[EMAIL PROTECTED]
{=0D=0A font-family: Cambria
Math;=0D=0A}=0D=0A@[EMAIL PROTECTED]
{=0D=0A font-family: Calibri;=0D=0A}=0D=0A@[EMAIL PROTECTED]
Garamond;=0D=0A}=0D=0A@[EMAIL PROTECTED]
Section1 {size: 8=2E5in 11=2E0in; margin:
1=
=2E0in 1=2E0in 1=2E0in 1=2E0in; }=0D=0AP=2EMsoNormal {=0D=0A FONT-SIZE:
11p=
t; MARGIN: 0in 0in 0pt; FONT-FAMILY:
"Calibri","sans-serif"=0D=0A}=0D=0ALI=
=2EMsoNormal {=0D=0A FONT-SIZE: 11pt; MARGIN: 0in 0in 0pt; FONT-FAMILY:
"Ca=
libri","sans-serif"=0D=0A}=0D=0ADIV=2EMsoNormal {=0D=0A FONT-SIZE: 11pt;
MA=
RGIN: 0in 0in 0pt; FONT-FAMILY: "Calibri","sans-serif"=0D=0A}=0D=0AA:link
{=
=0D=0A COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99=0D=
=0A}=0D=0ASPAN=2EMsoHyperlink {=0D=0A COLOR: blue; TEXT-DECORATION:
underli=
ne; mso-style-priority: 99=0D=0A}=0D=0AA:visited {=0D=0A COLOR: purple;
TEX=
T-DECORATION: underline; mso-style-priority:
99=0D=0A}=0D=0ASPAN=2EMsoHyper=
linkFollowed {=0D=0A COLOR: purple; TEXT-DECORATION: underline;
mso-style-p=
riority: 99=0D=0A}=0D=0ASPAN=2EEmailStyle17 {=0D=0A FONT-WEIGHT: normal;
CO=
LOR: windowtext; FONT-STYLE: normal; FONT-FAMILY: "Garamond","serif";
mso-s=
tyle-type: personal-compose=0D=0A}=0D=0A=2EMsoChpDefault
{=0D=0A mso-style-=
type: ex****t-only=0D=0A}=0D=0ADIV=2ESection1 {=0D=0A page:
Section1=0D=0A}=
=0D=0A</STYLE>=0D=0A<!--[if gte mso 9]><xml>=0D=0A <o:shapedefaults v:ext=
=3D"edit" spidmax=3D"1026" />=0D=0A</xml><![endif]--><!--[if gte mso
9]><xm=
l>=0D=0A <o:shapelayout v:ext=3D"edit">=0D=0A <o:idmap v:ext=3D"edit"
data=
=3D"1" />=0D=0A </o:shapelayout></xml><![endif]--></HEAD>=0D=0A<BODY lang=
=3DEN-US vLink=3Dpurple link=3Dblue>=0D=0A<DIV dir=3Dltr
align=3Dleft><SPAN=
class=3D634042520-01042008><FONT face=3DArial =0D=0Acolor=3D#0000ff size=
=3D2>One question=2E If you are using VS 2008 and presumably =0D=0A=
=2ENET Framework, why are you not using the PostgreSQL ADO=2ENET
driv=
er =0D=0Ainstead of ODBC?</FONT></SPAN></DIV>=0D=0A<DIV dir=3Dltr
align=3Dl=
eft><SPAN class=3D634042520-01042008><FONT face=3DArial
=0D=0Acolor=3D#0000=
ff size=3D2></FONT></SPAN> </DIV>=0D=0A<DIV dir=3Dltr
align=3Dleft><SP=
AN class=3D634042520-01042008><FONT face=3DArial =0D=0Acolor=3D#0000ff
size=
=3D2><A
=0D=0Ahref=3D"http://pgfoundry=2Eorg/projects/npgsql">http://pgfoun=
dry=2Eorg/projects/npgsql</A></FONT></SPAN></DIV>=0D=0A<DIV dir=3Dltr
align=
=3Dleft><SPAN class=3D634042520-01042008><FONT face=3DArial
=0D=0Acolor=3D#=
0000ff size=3D2></FONT></SPAN> </DIV>=0D=0A<DIV dir=3Dltr
align=3Dleft=
><SPAN class=3D634042520-01042008><FONT face=3DArial =0D=0Acolor=3D#0000ff
=
size=3D2></FONT></SPAN> </DIV><BR>=0D=0A<DIV
class=3DOutlookMessageHea=
der lang=3Den-us dir=3Dltr align=3Dleft>=0D=0A<HR
tabIndex=3D-1>=0D=0A<FONT=
face=3DTahoma size=3D2><B>From:</B> pgsql-odbc-owner@[EMAIL PROTECTED]
<B>On Behalf Of </B>Charles
S=
=2E =0D=0AHenkel<BR><B>Sent:</B> Tuesday, April 01, 2008 3:57
PM<BR><B>To:<=
/B> =0D=0Apgsql-odbc@[EMAIL PROTECTED]
><B>Subject:</B> [ODBC] VS2008:
Sim=
ple DataGridView =0D=0Anot
populating<BR></FONT><BR></DIV>=0D=0A<DIV></DIV>=
=0D=0A<DIV class=3DSection1>=0D=0A<P class=3DMsoNormal><B><SPAN
=0D=0Astyle=
=3D"FONT-SIZE: 12pt; FONT-FAMILY:
'Garamond','serif'">Context:<o:p></o:p></=
SPAN></B></P>=0D=0A<P class=3DMsoNormal><SPAN =0D=0Astyle=3D"FONT-SIZE:
12p=
t; FONT-FAMILY: 'Garamond','serif'"><o:p> </o:p></SPAN></P>=0D=0A<P
cl=
ass=3DMsoNormal><SPAN =0D=0Astyle=3D"FONT-SIZE: 12pt; FONT-FAMILY:
'Garamon=
d','serif'">Windows Vista =0D=0Ax64<o:p></o:p></SPAN></P>=0D=0A<P
class=3DM=
soNormal><SPAN =0D=0Astyle=3D"FONT-SIZE: 12pt; FONT-FAMILY:
'Garamond','ser=
if'">PostgreSQL 8=2E3 (server =0D=0Aon
localhost)<o:p></o:p></SPAN></P>=0D=
=0A<P class=3DMsoNormal><SPAN =0D=0Astyle=3D"FONT-SIZE: 12pt; FONT-FAMILY:
=
'Garamond','serif'">psql-obdc =0D=0Av8=2E03=2E01<o:p></o:p></SPAN></P>=0D=
=0A<P class=3DMsoNormal><SPAN =0D=0Astyle=3D"FONT-SIZE: 12pt; FONT-FAMILY:
=
'Garamond','serif'">Visual Studio 2008
=0D=0A(VS2008)<o:p></o:p></SPAN></P>=
=0D=0A<P class=3DMsoNormal><SPAN =0D=0Astyle=3D"FONT-SIZE: 12pt;
FONT-FAMIL=
Y: 'Garamond','serif'"><o:p> </o:p></SPAN></P>=0D=0A<P
class=3DMsoNorm=
al><B><SPAN =0D=0Astyle=3D"FONT-SIZE: 12pt; FONT-FAMILY:
'Garamond','serif'=
">Problem:<o:p></o:p></SPAN></B></P>=0D=0A<P class=3DMsoNormal><SPAN
=0D=0A=
style=3D"FONT-SIZE: 12pt; FONT-FAMILY:
'Garamond','serif'"><o:p> </o:p=
></SPAN></P>=0D=0A<P class=3DMsoNormal><SPAN =0D=0Astyle=3D"FONT-SIZE:
12pt=
; FONT-FAMILY: 'Garamond','serif'">I created a System DSN =0D=0Ausing the
D=
ata Sources (ODBC) administration tool located in
=0D=0A<system>\SysW=
OW64\odbcad32=2Eexe=2E Note that this is *<B>not</B>* the same =0D=0Aone
yo=
u get from Control Panel ->Administrative Tools (that one is in
=0D=0A&l=
t;system>/system32 and can apparently only manage 64 bit DSNs)=2E Test
=
=0D=0Asuccessful=2E<o:p></o:p></SPAN></P>=0D=0A<P class=3DMsoNormal><SPAN
=
=0D=0Astyle=3D"FONT-SIZE: 12pt; FONT-FAMILY:
'Garamond','serif'"><o:p> =
;</o:p></SPAN></P>=0D=0A<P class=3DMsoNormal><SPAN
=0D=0Astyle=3D"FONT-SIZE=
: 12pt; FONT-FAMILY: 'Garamond','serif'">In VS2008, add new Data
=0D=0ASour=
ce picking up one table from the DSN just created=2E On Data Sources
=
=0D=0Atab, can rightclick the table and "Preview Data"=2E=2E=2Eworks fine
i=
n the IDE, =0D=0Asuccessfully retrieving data from the
database=2E<o:p></o:=
p></SPAN></P>=0D=0A<P class=3DMsoNormal><SPAN =0D=0Astyle=3D"FONT-SIZE:
12p=
t; FONT-FAMILY: 'Garamond','serif'"><o:p> </o:p></SPAN></P>=0D=0A<P
cl=
ass=3DMsoNormal><SPAN =0D=0Astyle=3D"FONT-SIZE: 12pt; FONT-FAMILY:
'Garamon=
d','serif'">Create a trivial =0D=0AWindows Forms Application with a
DataGri=
dView [DGV] control=2E No =0D=0Acode-behind=2E=2E=2Ejust connect the DGV
Da=
ta Source to the DSN table=2E Run the =0D=0Aapplication=2E=2E=2Eno data in
=
DGV=2E<o:p></o:p></SPAN></P>=0D=0A<P class=3DMsoNormal><SPAN
=0D=0Astyle=3D=
"FONT-SIZE: 12pt; FONT-FAMILY:
'Garamond','serif'"><o:p> </o:p></SPAN>=
</P>=0D=0A<P class=3DMsoNormal><SPAN =0D=0Astyle=3D"FONT-SIZE: 12pt;
FONT-F=
AMILY: 'Garamond','serif'">Do exact same thing =0D=0Aexcept with Northwind
=
DSN (sample SQL Server database, not using PostgreSQL or =0D=0Apsql-odbc)=
=2E=2E=2Erun app=2E=2E=2EDGV populates just fine=2E<o:p></o:p></SPAN></P>=
=0D=0A<P class=3DMsoNormal><SPAN =0D=0Astyle=3D"FONT-SIZE: 12pt;
FONT-FAMIL=
Y: 'Garamond','serif'"><o:p> </o:p></SPAN></P>=0D=0A<P
class=3DMsoNorm=
al><B><SPAN =0D=0Astyle=3D"FONT-SIZE: 12pt; FONT-FAMILY:
'Garamond','serif'=
">Analysis:<o:p></o:p></SPAN></B></P>=0D=0A<P class=3DMsoNormal><SPAN =0D=
=0Astyle=3D"FONT-SIZE: 12pt; FONT-FAMILY:
'Garamond','serif'"><o:p> </=
o:p></SPAN></P>=0D=0A<P class=3DMsoNormal><SPAN =0D=0Astyle=3D"FONT-SIZE:
1=
2pt; FONT-FAMILY: 'Garamond','serif'">Enabling mylog in =0D=0Apsql-odbc
doe=
sn't give much information=2E If I log the VS2008 IDE interaction
=0D=0Awit=
h the DSN (e=2Eg=2E, when using "Preview Data")=2E=2E=2Eit all looks good=
=2E =0D=0A<o:p></o:p></SPAN></P>=0D=0A<P class=3DMsoNormal><SPAN
=0D=0Astyl=
e=3D"FONT-SIZE: 12pt; FONT-FAMILY:
'Garamond','serif'"><o:p> </o:p></S=
PAN></P>=0D=0A<P class=3DMsoNormal><SPAN =0D=0Astyle=3D"FONT-SIZE: 12pt;
FO=
NT-FAMILY: 'Garamond','serif'">If I compile the app =0D=0Aand execute it
wi=
th mylog enabled=2E=2E=2Enothing in the log file except the
=0D=0Aintializa=
tion from turning on logging=2E That is, the app never finds the DSN, and
=
=0D=0Ain fact gives an error to that effect:<o:p></o:p></SPAN></P>=0D=0A<P
=
class=3DMsoNormal><SPAN =0D=0Astyle=3D"FONT-SIZE: 12pt; FONT-FAMILY:
'Garam=
ond','serif'"><o:p> </o:p></SPAN></P>=0D=0A<P class=3DMsoNormal><SPAN
=
=0D=0Astyle=3D"FONT-SIZE: 12pt; FONT-FAMILY: 'Garamond','serif'">[ERROR]
[I=
M002] =0D=0A[Microsoft] [ODBC Driver Manager] Data source name not found
an=
d no default =0D=0Adriver specified=2E<o:p></o:p></SPAN></P>=0D=0A<P
class=
=3DMsoNormal><SPAN =0D=0Astyle=3D"FONT-SIZE: 12pt; FONT-FAMILY:
'Garamond',=
'serif'"><o:p> </o:p></SPAN></P>=0D=0A<P class=3DMsoNormal><SPAN =0D=
=0Astyle=3D"FONT-SIZE: 12pt; FONT-FAMILY: 'Garamond','serif'">So it
appears=
that this =0D=0Amay be an x64 issue=2E=2E=2EThe application can't find
the=
DSN probably because there =0D=0Ais no entry for it in
HKEY_LOCAL_MACHINE\=
SOFTWARE\ODBC\ODBC=2EINI=2E=2E=2Einstead the =0D=0Aentry is in the
redirect=
ed key =0D=0AHKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC=2EINI but
it=
's not getting =0D=0Aredirected there=2E<o:p></o:p></SPAN></P>=0D=0A<P
clas=
s=3DMsoNormal><SPAN =0D=0Astyle=3D"FONT-SIZE: 12pt; FONT-FAMILY:
'Garamond'=
,'serif'"><o:p> </o:p></SPAN></P>=0D=0A<P class=3DMsoNormal><SPAN
=0D=
=0Astyle=3D"FONT-SIZE: 12pt; FONT-FAMILY: 'Garamond','serif'">I can't
under=
stand why =0D=0Athe VS2008 IDE can interact with the DSN just fine, but
the=
simple app can't =0D=0Afind it=2E Perhaps there's a "target platform" I
ha=
ve to specify? Any =0D=0Aideas?<o:p></o:p></SPAN></P>=0D=0A<P
class=3DMsoNo=
rmal><B><SPAN =0D=0Astyle=3D"FONT-SIZE: 12pt; FONT-FAMILY:
'Garamond','seri=
f'"><o:p> </o:p></SPAN></B></P>=0D=0A<P class=3DMsoNormal><B><SPAN
=0D=
=0Astyle=3D"FONT-SIZE: 12pt; FONT-FAMILY:
'Garamond','serif'"><o:p> </=
o:p></SPAN></B></P>=0D=0A<P class=3DMsoNormal><B><SPAN
=0D=0Astyle=3D"FONT-=
SIZE: 12pt; FONT-FAMILY: 'Garamond','serif'">Charles S=2E
=0D=0AHenkel<o:p>=
</o:p></SPAN></B></P>=0D=0A<P class=3DMsoNormal><I><SPAN
style=3D"FONT-FAMI=
LY: 'Garamond','serif'">Henkel =0D=0ATechnical Computing,
LLC<o:p></o:p></S=
PAN></I></P>=0D=0A<P class=3DMsoNormal><SPAN =0D=0Astyle=3D"FONT-SIZE:
10pt=
; FONT-FAMILY: 'Garamond','serif'">9917 Laurel Springs
=0D=0AAve<o:p></o:p>=
</SPAN></P>=0D=0A<P class=3DMsoNormal><SPAN =0D=0Astyle=3D"FONT-SIZE:
10pt;=
FONT-FAMILY: 'Garamond','serif'">Las Vegas, NV
=0D=0A89134<o:p></o:p=
></SPAN></P>=0D=0A<P
class=3DMsoNormal><o:p> </o:p></P></DIV></BODY></=
HTML>=0D=0A=0D=0A
------_=_NextPart_001_01C89436.C9A4F2C7--


|