Re: ODBC table views

From: Michael Krolewski <mikkro_at_hbsi.com>
Date: 1997/12/01
Message-ID: <3482978C.CC1_at_hbsi.com>#1/1


Martin Bremer wrote:
>
> Hi,
>
> I am using an ODBC driver to connect a Visual Basic program to an
> Oracle database. It turns out that the table names now have a prefix
> consisting of the login name. Example:
>
> login name = db_info
> table name= persons
>
> With ODBC: table name = db_info_persons
>
> Is there a way of getting rid of this prefix? I don't want to change
> my SQL statements because I also
> use them in a Unix version where it all works fine.
> I also see these large table names when I connect a Microsoft Access
> database to the Oracle database, so it must be the ODBC driver that is
> doing something here. But why is the ODBC-test program working without
> the prefixes. Please help me with this puzzle. Thanks in advance,
>
> Martin Bremer
>
>
> --
> Martin Bremer
>
> Institute: SRON - Utrecht
> Address: Sorbonnelaan 2, 3584 CA Utrecht, The Netherlands
>
> Phone: International -31-30-2535616 (work) -31-30-2535600 (central facility)
> -31-30-2540860 (fax)
>
> Email: M.Bremer_at_sron.ruu.nl
> WWW: http://www.sron.ruu.nl/~martinb
>
>

There are two ways to change the names

One is to use rename ... via point and right mouse, etc

Another is to use write a short access function I cannot recall the name of the field but one of the fields in the database structure has the name of the tables.

While looping thru the tables

	if  ( mid$( x.table_name, 1, k ) = 'username_' ) then
		x.table_name = mid$(x.table_name,k);
	end if;

I believe there is an example of getting table names plus other database objects in help.

Then run the macro...

Mike Krolewski Received on Mon Dec 01 1997 - 00:00:00 CET

Original text of this message