[ic] No Access to Database

Harley McCabe interchange-users@icdevgroup.org
Wed Nov 13 21:26:01 2002


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.


I created all of the tables in the same manner, why would one not work?  I
am using MySql and have some history of battling with MySql access
permissions from previous projects.  Therefore I was quite prepared to blame
that.  However I haven't set any table level access permissions so, from the
MySQL side, if one table works so should all the others.

A look at some debugging info seems to indicate that DBI can access the
countries table ok:

Vend::Data:debug: ready to try opening db countries
    <- FETCH('Driver')= DBI::dr=HASH(0x81cd190) at DBI.pm line 492
    <- STORE('PrintError' 0)= 1 at DBI.pm line 509
    <- STORE('RaiseError' 1)= 1 at DBI.pm line 509
Vend::Data:debug: Opening countries: RO= WC= WA=
    <- prepare('select * from countries ')= DBI::st=HASH(0x9245928) at
DBI.pm line 1466
    <- execute= 6 at DBI.pm line 1468
    <- fetchrow_arrayref= [ 'NZL' 'New Zealand' 'a' ] row1 at DBI.pm line
1471
    <- fetchrow_arrayref= undef row6 at DBI.pm line 1471
    <- DESTROY= undef at DBI.pm line 1481
    <- quote('AUS')= ''AUS'' at DBI.pm line 1135
    <- prepare('select * from countries where id = 'AUS'')=
DBI::st=HASH(0x925f86c) at DBI.pm line 1137
    <- execute= 1 at DBI.pm line 1139
1   <- fetch= [ 'AUS' 'Australia' 'b' ] row1 at DBI.pm line 1142
1   <- FETCH('NAME')= [ 'id' 'name' 'region' ] at DBI.pm line 1142
    <- fetchrow_hashref= HASH(0x9252f14)3keys row1 at DBI.pm line 1142
    <- DESTROY= undef at Interpolate.pm line 4392

I have the sneaking suspicion that I'll be kicking myself about this one,
but for now I'm out of ideas.  I am running Interchange 4.8.6.  Any words of
wisdom would be much appreciated...

Harley