Mark Franz
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 .Connectio n")
strConn = "DSN=SERVER314CBF7B;uid=db a;pwd=dba; "
conn.Open strConn
Set rs = conn.OpenSchema(adSchemaTa bles)
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...
<%
Dim conn, strConn, rs
Set conn = Server.CreateObject("ADODB
strConn = "DSN=SERVER314CBF7B;uid=db
conn.Open strConn
Set rs = conn.OpenSchema(adSchemaTa
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...
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.
ado provides loads of things but not every thing is supported, i.e recordcount property etc.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks! Where did you get the operator (20) from?
Mark
Mark
ASKER
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.
makerp,
RecordCount is supported by
Const adOpenKeyset = 1
Const adOpenStatic = 3
not by the other Cursor Type options.
ASKER
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?
ASKER
.. I know it's far fetched, I just follow the rules set by my customer... ;-)
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.