IonicWind Software

IWBasic => Database => Topic started by: talun on July 15, 2009, 05:22:09 AM

Title: access tables
Post by: talun on July 15, 2009, 05:22:09 AM
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
Title: Re: access tables
Post by: Bruce Peaslee on July 15, 2009, 10:12:36 AM
I don't really understand the question, but I use Access all the time without too much difficulty (weak on memo fields).
Title: Re: access tables
Post by: Ficko on July 15, 2009, 10:14:01 AM
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
Title: Re: access tables
Post by: peterpuk on July 15, 2009, 06:13:35 PM
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
Title: Re: access tables
Post by: talun on July 16, 2009, 01:14:26 AM
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