Cannot access views
Cannot access views
От:
Joern Muehlencord <jomu@uni-paderborn.de>
Дата:
Hi together,
I have got a problem to access views I have created from MS Word. The
message says ("Error: Could not open datasource", after (!!) I have
selected the data and told the DDE to return the data to Word. I am
using:
-Postgres 7.03 on a MDK 8.0 System,
-Word running on a Win95-System
If I try to access the adresstable directly, it is all fine - only if I
take the view (because I want to automate a massletter as far as
possible - even the view, which selects the adresses using a
"n:m-resolve-table", is created automaticly) I cant succsess.
Any hints?
--
Linux is like a wigwam - no Windows, no Gates and Apache inside
Re: Cannot access views
От:
Joern Muehlencord <jomu@uni-paderborn.de>
Дата:
Hello Cedar, > hmm.. I still don't completely understand. Let's say, for example, you > have a test table "testtable" and view "testview". If I understand, from > psql you can select * from both and it works, but going into Word > testtable works but testview does not. Correct? Yes - that is the problem. Using psql I can do everything I want to - what ever I use (view or table). Using Word I can only access the table. testview was createte by something like that: create view testview as select * from testtable where id in (select adressid from lists where listid = '1') lists is a "n:m-resolve-Table" (creating n lists with m datasets from testtable) bye joern
Re: Cannot access views
От:
Chris Andrews <chris@netsw.co.uk>
Дата:
On Wed, 20 Jun 2001, Joern Muehlencord wrote: > Hello Cedar, > > > hmm.. I still don't completely understand. Let's say, for example, you > > have a test table "testtable" and view "testview". If I understand, from > > psql you can select * from both and it works, but going into Word > > testtable works but testview does not. Correct? > Yes - that is the problem. Using psql I can do everything I want to - what > ever I use (view or table). Using Word I can only access the table. > testview was createte by something like that: > create view testview as select * from testtable where id in (select adressid > from lists where listid = '1') > lists is a "n:m-resolve-Table" (creating n lists with m datasets from > testtable) I found a problem using Word 97 (and MSQuery) and Postgres: if the query string put together by MSQuery is longer than 255 characters, it will add a carriage return every 256 characters... this appears to be a generic Word problem - I found vague references to it in the MS tech web site, and a potential fix in Office 2000 SP1. The symptoms were that MSQuery would complain "can't open the datasource" - or some similar useless error. The errors from postgres were of the form 'error in SQL syntax' followed by some truncated-looking SQL. Typically the error would be mismatched quotes. I watched the network during queries and noted the extra line breaks. Ironically, my workaround is to define a view which only returns the fields I want so I can say 'SELECT * FROM my_view;', which is shorter than 255 chars, and seems to work ok. I'd be surprised if this is what you're seeing, but it's worth a mention. Chris.