[ic] No Access to Database

Mike Heins interchange-users@icdevgroup.org
Wed Nov 13 21:49:00 2002


Quoting Harley McCabe (harley.mccabe@alliedpress.co.nz):
> 
> Hi,
> I have a seemingly simple problem that has outstayed its welcome.  At first
> view it seems a simple access permissions problem (though it should be noted
> I'm no interchange expert), but it just refuses to budge.  The details are;
> when the code snippet below (from the checkout) executes:
> 
>     $region = $Tag->data('countries', 'region', $Values->{country});
> 
> I get the following error in the error.log:
> 
>     /cgi-bin/tutorial/process Safe: no access for database countries at
> /usr/local/interchange/lib/Vend/Data.pm line 906.
> 
> I am perplexed by this error for two reasons.
> 
> 1) The following code works (in checkout.html) - the select dropdown is
> populated with the countries from the countries table.:
> 
>     <SELECT onChange="this.form.submit()" NAME=country>
>         [loop option=country search="
>           ra=yes
>           fi=countries
>           st=db
>           rf=id,name
>           ml=1000
>           tf=name
>         "]
>         <OPTION VALUE="[loop-code]"> [loop-data countries name][/loop]
>       </SELECT>
> 
> 2) OK, so interchange can in fact access the table, maybe it has something
> to do with the data tag?  Hmmm, I tried substituting other tables into the
> code:
> 
>     $region = $Tag->data('products', 'description', '1');
> 
> and it works fine.

You have never shared your country table for embedded Perl. Try
putting [perl tables=country][/perl] somewhere above the region and
all should be well.

-- 
Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.513.523.7621      <mike@perusion.com>

When the only tool you have is a hammer, all your problems tend to look
like nails.  -- Abraham Maslow