Problem with VB-DirectODBC selecting text-fields [EBEWE: Virus checked]

From: Wolfgang(dot)Fuertbauer(at)ebewe(dot)com
To: pgsql-odbc(at)postgresql(dot)org
Subject: Problem with VB-DirectODBC selecting text-fields [EBEWE: Virus checked]
Date: 2002-03-05 08:10:42
Message-ID: C1256B73.002CEE67.00@mail.ebewe.co.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Hi,

i have a problem with the following SQL-Statement:

Select Groessen from Weg where Bsnr = 14957 and Znr = 1 and wegkz = 1;

when executing it via direct-odbc in VB it gives me the error-nr: 3146

the VB-Code:
------------
Set myConn = myWs.OpenConnection("", _
dbDriverNoPrompt, _
False,_
"ODBC;dsn=PostgreSQL;uid=postgres;pwd=;")
sql = "Select Groessen from Weg where Bsnr = 14957 and Znr = 1 and wegkz =
1"
Set rs = myConn.OpenRecordset(Sql, _
dbOpenSnapshot, _
dbExecDirect, _
dbOptimistic)

the database:
-------------
7.1.3

the ODBC-Version:
-----------------
7.01.00.09

the table 'weg' in database 'fakt32':
-------------------------------------

fakt32=#\d weg

Attribute | Type | Modifier
-------------+-----------------------+----------------------------
inr | integer | not null default
nextval('"weg_inr_seq"'::text)
wegnr | integer | default 0
wegkz | smallint | default 0
bsnr | integer | default 0
znr | integer | default 0
arnr | character varying(15) |
arname | character varying(30) |
arlfnr | integer | default 0
arlfname | character varying(25) |
arlfarnr | character varying(15) |
datum | date |
bkz | integer | default 0
groessen | text |
bestellung | text |
Indices: weg_bsnr_key,
weg_pkey,
weg_wegnr_key

- excuting the same query via psql works fine:
fakt32=# Select Groessen from Weg where Bsnr = 14957 and Znr = 1 and
wegkz = 1;
groessen
---------------
6;72;0;7;32;0
(1 row)

- executing the same query via pgadmin II also works fine
- executing the same query via Access (linked table) also works fine
- looking at the logs:

in psqlodbc_4294820759.log beginning from line 170:
--------------------------

>conn=170740516, query='Select Groessen from Weg where Bsnr = 14914 and
>Znr = 1 and wegkz = 1'
> [ fetched 1 rows ]

that's OK

>conn=170740516, query='SELECT * FROM Select Groessen from Weg where Bsnr
>= 14914 and Znr = 1 and >wegkz = 1'

???? where does this "SELECT * " come from ?

>ERROR from backend during send_query: 'ERROR: parser: parse error at or
>near "Select"'

this is the result of the 2nd (wrong) query

mylog_4294820759.log shows the same beginning from line 94853

Please help!

(See attached file: psqlodbc_4294820759.zip)(See attached file:
mylog_4294820759.zip)

mfG

----------------------------------------------------------
Wolfgang Fuertbauer, wolfgang(dot)fuertbauer(at)ebewe(dot)com
c/o EBEWE Pharma Ges.m.b.H Nfg.KG Tel: +43 7665 8123 315
Mondeseestrasse 11 Fax: +43 7665 8123 11
4866 Unterach, Austria

Attachment Content-Type Size
psqlodbc_4294820759.zip application/zip 2.4 KB
mylog_4294820759.zip application/zip 319.3 KB

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Booth, Robert 2002-03-05 23:28:06 "This recordset is not updateable"
Previous Message Hiroshi Inoue 2002-03-04 23:44:33 Re: returning refcursors (into Visual Basic)