Avatar billede linroc Nybegynder
03. marts 2005 - 11:34 Der er 9 kommentarer og
1 løsning

liste alle sybase tabeller med access odbc

Hej,

jeg har en odbc forbindelse til en sybase db - er der en måde jeg kan få en kompet liste over tabellerne i sybase db'en.

Jeg ved godt at jeg kan se dem nå jeg laver en import, men der er så mange at jeg godt vil have dem over i en tabel.

Kan man det måske via en sql kommando direkte på db'en - men hvordan laver jeg sådan en ??

/Claus
Avatar billede terry Ekspert
03. marts 2005 - 19:41 #1
Its years since I played ariund with Sybase but as SQL Server is based on this then you may be anble to use this.

The sysobjects table conatins information on tables, views etc. so an SQL

SELECT * from sysobjects where type = 'U'

should give you the USER tables. Obviously you will need the correct permissions to select from the table.

In Access it is also possible to make what is called a Pass-through query. This sends the SQL to the database where it gets executed (if valid). It may be necessary to use such a query if the sysobjects table isnt available in the list when you try linking tables.
Avatar billede terry Ekspert
03. marts 2005 - 20:11 #2
You can create a Pass-through query in code
http://support.microsoft.com/kb/q210415/

In Access you can make a passthrough query by making a normal query but without selecting any tables. Then right click in the query window and choose SQL Specific and then Pass-Through. Then you write the SQL given above. You can NOT use the SQL designer as the SQL is specific to the database type.
Now when you run the query you will need to choose which DSN to use.
Avatar billede linroc Nybegynder
08. marts 2005 - 10:03 #3
Thanks for the reply Terry,

It won't be possible for me to test this before the end of the month, but sounds like it is what i need :-)

/Claus
Avatar billede terry Ekspert
08. marts 2005 - 12:29 #4
Ok, I'll place an answer now hope to hear from you as soon as you have tested.
Terry
Avatar billede terry Ekspert
08. marts 2005 - 12:29 #5
.
Avatar billede terry Ekspert
04. april 2005 - 19:34 #6
whats the status here Claus?
Avatar billede terry Ekspert
06. maj 2005 - 15:47 #7
Hi Claus
Two months have gone by now, can we close this question please?
mvh
Terry
Avatar billede terry Ekspert
18. maj 2005 - 10:33 #8
may as well forget this one
Avatar billede linroc Nybegynder
19. maj 2005 - 08:54 #9
Hi Terry,

sorry for not returning - but my wife gave bith to a son and then and other things became less important :-)

But thanks for yor reply - and sorry for slow reply.

/Claus
Avatar billede terry Ekspert
19. maj 2005 - 12:06 #10
Hi Claus
Congratulations with your son, I can fully understand that your family is more important than "work"

and thanks for the points
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Dyk ned i databasernes verden på et af vores praksisnære Access-kurser

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester