July 01, 2022, 01:39:31 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


access tables

Started by talun, July 15, 2009, 05:22:09 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

talun

Hi,
I have a Access database with tables of differente type (System tables, View, Access tables and Tables) and I need to read only the contents of the "Tables".
I would like to know if with the Ebasic database library is possible to choose the differente table type.

Thanks!

Sergio

Bruce Peaslee

I don't really understand the question, but I use Access all the time without too much difficulty (weak on memo fields).
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

Ficko

Hi Sergio!

I am not sure understand your question 100%

Quote
..choose the differente table type ???

Usually you are accessing tables by they name not by type but generally everything you are able to accomplish in a databank through SQL statements you can do it through EBasic since it has "dbExecSQL" command.
So just use Access query wizard to develop your query and copy-paste it into a string.

Ficko

peterpuk

July 15, 2009, 06:13:35 PM #3 Last Edit: July 15, 2009, 06:18:07 PM by peterpuk
I use a check for MSYS in the table name (first 4 characters)... like in the following code. These are usually the system tables which you don't want to touch.

This example loads a listview control with all tables that do not start with MSYS...ie users tables only.

pTables = dbListTables(pdb)
IF pTables <> NULL
   FOR temp = EACH pTables as STRING
      IF ucase$(left$(#temp,4))<>"MSYS"
         CONTROLCMD w1,LISTVIEW_TABLES,@LVINSERTITEM,RecCount,#temp
         RecCount=RecCount+1
      ENDIF
   NEXT
   ListRemoveAll(pTables,TRUE)
ELSE
   messagebox w1,"Unable to list Tables","Load Listview",@MB_ICONSTOP | @MB_OK
ENDIF
Peter

talun

Many thanks to all for the replies.

The Peterpuk suggestion should work for my needs. Hovewer i think that is possible to use the SQLTables() function declared in sql.inc that allows to define the table type (googling the web I found several Visual Basic and C++ examples). If I understand how to use it, maybe I can solve my problem.

bye  :)

Sergio