Solved

Return all tables from a SQL Anywhere dB

Posted on 2000-03-30
9
294 Views
Last Modified: 2012-05-07
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...
0
Comment
Question by:mgfranz
9 Comments
 
LVL 1

Expert Comment

by:vujos
Comment Utility
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.
0
 
LVL 10

Expert Comment

by:makerp
Comment Utility
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.
0
 
LVL 15

Accepted Solution

by:
robbert earned 50 total points
Comment Utility
<%
Dim conn, strConn, rs

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

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

Author Comment

by:mgfranz
Comment Utility
Thanks!  Where did you get the operator (20) from?

Mark
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 18

Author Comment

by:mgfranz
Comment Utility
Never mind robbert... I found it, (doh)  
0
 
LVL 15

Expert Comment

by:robbert
Comment Utility
adovbs.inc

makerp,
RecordCount is supported by
Const adOpenKeyset = 1
Const adOpenStatic = 3
not by the other Cursor Type options.
0
 
LVL 18

Author Comment

by:mgfranz
Comment Utility
I usually do not include the adovbs.inc file for security reasons.  I guess I could simply rename the file and then include it.
0
 
LVL 15

Expert Comment

by:robbert
Comment Utility
Hacking a constants list?
0
 
LVL 18

Author Comment

by:mgfranz
Comment Utility
..  I know it's far fetched, I just follow the rules set by my customer... ;-)
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now