Link to home
Start Free TrialLog in
Avatar of Mark Franz
Mark FranzFlag for United States of America

asked on

Return all tables from a SQL Anywhere dB

I need to return all the tables from a SQL Anywhere dB, I thought this would work;

<%
Dim conn, strConn, rs

Set conn = Server.CreateObject("ADODB.Connection")
strConn = "DSN=SERVER314CBF7B;uid=dba;pwd=dba;"

conn.Open strConn
Set rs = conn.OpenSchema(adSchemaTables)
   Do Until rs.EOF
         Response.Write  "Table name: " & rs.TABLE_NAME  & "<br>"
         rs.MoveNext
   Loop
rs.Close
conn.Close
%>

Here is the error;

ADODB.Connection error '800a0cb3'

The operation requested by the application is not supported by the provider.

/test/sqltable.asp, line 24


Does SQL not allow the OpenSchema operation?  I have been reading that is does...
Avatar of vujos
vujos

Hi,

You should be able to find all of the tables in SQLAnywhere database by executing following sql statement

select * from SYSTABLE

More about SQL anywhere system tables you can find at :

http://www.bcarter.com/sa_tab.htm

In this case instead OpenSchema use Execute method with above sql statement.

Hope this helps.
Avatar of Paul Maker
its not that, its the fact that your underlying data provider does not support it.

ado provides loads of things but not every thing is supported, i.e recordcount property etc.
ASKER CERTIFIED SOLUTION
Avatar of robbert
robbert

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mark Franz

ASKER

Thanks!  Where did you get the operator (20) from?

Mark
Never mind robbert... I found it, (doh)  
adovbs.inc

makerp,
RecordCount is supported by
Const adOpenKeyset = 1
Const adOpenStatic = 3
not by the other Cursor Type options.
I usually do not include the adovbs.inc file for security reasons.  I guess I could simply rename the file and then include it.
Hacking a constants list?
..  I know it's far fetched, I just follow the rules set by my customer... ;-)