Re: Problem accessing View in VB6

Lists: pgsql-students
From: oca(at)mvc(dot)edu(dot)ph
To: pgsql-students(at)postgresql(dot)org
Subject: Problem accessing View in VB6
Date: 2008-08-09 14:15:16
Message-ID: 20080809221516.80lhop5lw04g4oc8@mail.mvc.edu.ph
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-students

hi,

I got problem accessing views in Visual Basic 6. 

Dim rsSchedule As New Recordset
With rsSchedule
    .Open "SELECT * FROM tvwClassSchedules", dbConn, adOpenDynamic,
adLockReadOnly
    .Close
End With

I got this error:

ERROR: relation "tvwClassSchedules" does not exist;
Error while executing the query

this view exist because i can use the view in pgAdmin to display
the records.

please help.

thank you,
ocavid


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: oca(at)mvc(dot)edu(dot)ph
Cc: pgsql-students(at)postgresql(dot)org
Subject: Re: Problem accessing View in VB6
Date: 2008-08-09 15:46:18
Message-ID: 489DBBCA.3040303@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-students

oca(at)mvc(dot)edu(dot)ph wrote:
>
> hi,
>
> I got problem accessing views in Visual Basic 6.
>
> Dim rsSchedule As New Recordset
> With rsSchedule
> .Open "SELECT * FROM tvwClassSchedules", dbConn, adOpenDynamic,
> adLockReadOnly
> .Close
> End With
>
> I got this error:
>
> ERROR: relation "tvwClassSchedules" does not exist;
> Error while executing the query
>
> this view exist because i can use the view in pgAdmin to display the
> records.
>
>

If that is really the name of the view then the name needs to be quoted
in double quotes. Postgres folds unquoted names to lower case.

cheers

andrew


From: oca(at)mvc(dot)edu(dot)ph
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: pgsql-students(at)postgresql(dot)org
Subject: Re: Problem accessing View in VB6
Date: 2008-08-09 16:22:02
Message-ID: 20080810002202.pj97hcciokowcw8o@mail.mvc.edu.ph
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-students


----- Message from andrew(at)dunslane(dot)net ---------
Date: Sat, 09 Aug 2008 11:46:18 -0400
From: Andrew Dunstan <andrew(at)dunslane(dot)net>
Reply-To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Subject: Re: [pgsql-students] Problem accessing View in VB6
To: oca(at)mvc(dot)edu(dot)ph
Cc: pgsql-students(at)postgresql(dot)org

>
>
> oca(at)mvc(dot)edu(dot)ph wrote:
>>
>> hi,
>>
>> I got problem accessing views in Visual Basic 6. Dim rsSchedule As
>> New Recordset
>> With rsSchedule
>> .Open "SELECT * FROM tvwClassSchedules", dbConn, adOpenDynamic,
>> adLockReadOnly
>> .Close
>> End With
>>
>> I got this error:
>>
>> ERROR: relation "tvwClassSchedules" does not exist;
>> Error while executing the query
>>
>> this view exist because i can use the view in pgAdmin to display
>> the records.
>>
>>
>
> If that is really the name of the view then the name needs to be quoted
> in double quotes. Postgres folds unquoted names to lower case.
>
> cheers
>
> andrew
>
> --
> Sent via pgsql-students mailing list (pgsql-students(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-students

----- End message from andrew(at)dunslane(dot)net -----

Thank you, that does the job, but i guess i have to use lowercases for
my views names.

oscar


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: oca(at)mvc(dot)edu(dot)ph
Cc: pgsql-students(at)postgresql(dot)org
Subject: Re: Problem accessing View in VB6
Date: 2008-08-09 17:31:54
Message-ID: 489DD48A.3090202@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-students

oca(at)mvc(dot)edu(dot)ph wrote:
>
>
> Thank you, that does the job, but i guess i have to use lowercases for
> my views names.
>
>

I don't see why. Just use:

.Open "SELECT * FROM ""tvwClassSchedules""", dbConn, adOpenDynamic,
adLockReadOnly

AFAIK that is the way to embed quotes in VB Strings.

cheers

andrew


From: oca(at)mvc(dot)edu(dot)ph
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: pgsql-students(at)postgresql(dot)org
Subject: Re: Problem accessing View in VB6
Date: 2008-08-09 22:09:13
Message-ID: 20080810060913.ncnymtb4g0wgo4sw@mail.mvc.edu.ph
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-students

----- Message from andrew(at)dunslane(dot)net ---------
    Date: Sat, 09 Aug 2008 13:31:54 -0400
    From: Andrew Dunstan <andrew(at)dunslane(dot)net>
Reply-To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Subject: Re: [pgsql-students] Problem accessing View in VB6
      To: oca(at)mvc(dot)edu(dot)ph
      Cc: pgsql-students(at)postgresql(dot)org

>
>
> oca(at)mvc(dot)edu(dot)ph wrote:
>>
>>
>> Thank you, that does the job, but i guess i have to use lowercases 
>> for my views names.
>>
>>
>
> I don't see why. Just use:
>
>     .Open "SELECT * FROM ""tvwClassSchedules""", dbConn, adOpenDynamic,
> adLockReadOnly
>
>
> AFAIK that is the way to embed quotes in VB Strings.
>
> cheers
>
> andrew
>
> --
> Sent via pgsql-students mailing list (pgsql-students(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-students[1]
----- End message from andrew(at)dunslane(dot)net -----

yes, but i guess it would be more easier for me to code when they
are in lower cases, i just rename the views to tvw_class_scedules.

thank you and have a great day!

Links:
------
[1] http://www.postgresql.org/mailpref/pgsql-students