Relation "tablename" does not exist

Поиск
Список
Период
Сортировка
Искать

Relation "tablename" does not exist

От:
"Johan van der Merwe" <johan@bnrel.co.za>
Дата:

I have posted this before without receiving replies

My code is as follows:

Public dbRemote As New Connection
Public rsData As New Recordset

dbRemote.Properties("Data Source").Value = "DSM"
dbRemote.Properties("Initial Catalog").Value = "BCM_DSM"
dbRemote.Properties("User ID").Value = "johan"
dbRemote.Properties("Password").Value = "johan"
dbRemote.Open

rsData.Open "tblSuburb", dbRemote, , , adCmdTable


I receive the error "Relation "tblSuburb" does not exist"

Cheers

Johan van der Merwe
Ballenden & Robb Consulting Engineers
Tel (043) 743 3809
Fax (043) 743 9321
Cell 082 5530445

"I Don't want to be a human being, I want to be a human doing"

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.8.4/363 - Release Date: 2006/06/13
 

Re: Relation "tablename" does not exist

От:
Richard Huxton <dev@archonet.com>
Дата:
Johan van der Merwe wrote:
> I have posted this before without receiving replies

Can't see it in the archives. Were you subscribed?

> My code is as follows:
> 
> Public dbRemote As New Connection
> Public rsData As New Recordset
> 
> dbRemote.Properties("Data Source").Value = "DSM"
> dbRemote.Properties("Initial Catalog").Value = "BCM_DSM"
> dbRemote.Properties("User ID").Value = "johan"
> dbRemote.Properties("Password").Value = "johan"
> dbRemote.Open
> 
> rsData.Open "tblSuburb", dbRemote, , , adCmdTable
> 
> 
> I receive the error "Relation "tblSuburb" does not exist"

Either you created the table quoted (thus preserving its case) and you 
are accessing it unquoted (so it's folded to lower-case) or the other 
way around. It's how PostgreSQL provides case-insensitive table-names.

So:
CREATE "TaBlE1" ...
SELECT * FROM "TaBlE1" (works)
SELECT * FROM table1 (fails)
CREATE TaBlE2 ...
SELECT * FROM "TaBlE2" (works)
SELECT * FROM table2 (works)
SELECT * FROM TABLE2 (works)

HTH
-- 
   Richard Huxton
   Archonet Ltd

Re: Relation "tablename" does not exist

От:
Michael Glaesemann <grzm@seespotcode.net>
Дата:

On Jun 15, 2006, at 15:52 , Johan van der Merwe wrote:

> My code is as follows:

Could you explain a bit more what this code is? Is it Java? Python?  
What does it do? I know it's not SQL, and I'm guessing it's some kind  
of ORM, but without more information I really don't know how to help  
(and perhaps others are having the same trouble).

> I receive the error "Relation "tblSuburb" does not exist"

What is the name of the table in the database itself? Can you provide  
an example of SQL that *does* do what you want? Or perhaps some psql  
output showing the table definition for "tblSuburb"? There's a chance  
that it's a quoting problem: your code is calling "tablSuburb" (with  
double-quotes, which tells the server to look for a case-sensitive  
match) and your table is actually named "tblsuburb". PostgreSQL  
downcases all unquoted identifiers.

Hope this helps a bit.

Michael Glaesemann
grzm seespotcode net



FAQ