[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ic] Getting database handle in UserTag


Quoting Mike Heins:

In a global UserTag, it is:

	my $db = dbref('products')
		or die "no products table";
	my $dbh = $db->dbh()
		or die "not a DBI table";

In a catalog UserTag, there is no reliable way to do it
because of Safe restrictions.

We have successfully used the following in catalog UserTags:

    my $db  = Vend::Data::database_exists_ref('products')
       or return sprintf("Table %s is not available", 'products');
    my $dbh = $db->dbh();

It may not be "proper" but it has worked successfully for years, which has been reliable enough for our purposes.

Carl Bailey
Triangle Research, Inc.
tel: +1.919.401.6588

_______________________________________________
interchange-users mailing list
suppressed
http://www.icdevgroup.org/mailman/listinfo/interchange-users


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.