Solved

Return all tables from a SQL Anywhere dB

Posted on 2000-03-30
9
332 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 1

Expert Comment

by:vujos
ID: 2671469
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
ID: 2672325
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
ID: 2672484
<%
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 18

Author Comment

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

Mark
0
 
LVL 18

Author Comment

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

Expert Comment

by:robbert
ID: 2673853
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
ID: 2673886
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
ID: 2674757
Hacking a constants list?
0
 
LVL 18

Author Comment

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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Microsoft SQL ADO Conn Issue 6 64
Select only the top record in a left join 13 49
ASP/VB email question 4 70
Session on Html 8 53
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
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/…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

739 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