Solved

Return all tables from a SQL Anywhere dB

Posted on 2000-03-30
9
322 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
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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PDF Embed pdfobject.js local path problem regular ASP 2 181
XML Parsing Classic ASP 5 65
Need help to rewrite script 3 95
RegEx Help - open to other simple suggestions 8 58
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…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

830 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