Solved

Return all tables from a SQL Anywhere dB

Posted on 2000-03-30
9
336 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

726 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