Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display question 6

Status
Not open for further replies.
Feb 29, 2004
75
US
I have the following ASP code which basically goes into the main database and lists all the databases tables. However i dont know how to output those results using the Response.write command. this does not work right now. How would I have to go about that. Thanks in advance

-CODE- mydbdetails.asp
<%
Set dbconn = Server.CreateObject("ADODB.Connection")
dbconn.open("Provider=SQLOLEDB; Data Source=sq111.crystech.com; Initial Catalog=mydbtest; User ID=mydbtest; Password=dotheftp; network=dbmcn")

strSQL="use maindbtest" &_
"go" &_
"select *" &_
"from INFORMATION_SCHEMA.COLUMNS" &_
"order by TABLE_NAME"

Response.Write("Done")
%>
 
[lol] was noticing that! maybe we can get a few more minds posting and make it a record length for this forum

___________________________________________________________________

The answer to your ??'s may be closer then you think.
Check out Tek-Tips knowledge bank by clicking the FAQ link at the top of the page faq333-3811
 
Item cannot be found in the collection corresponding to the requested name or ordinal.

line -> response.write(rs("table_name"))
 
yes we should make it a record. waht is the record posting anways???
 
lets try something a little different, remove rs.close() leave set rs = nothing, and swap around the middle code to this, and see if this yields any results for you.

Code:
Set rs = dbconn.OpenSchema(adSchemaTables, _
         Array("Pubs", Empty, Empty, "Table")
If Not rs.EOF Then
  do while not rs.eof
      response.write(rs("[Table_Name]"))
      response.Write "<br>"
  rs.movenext
  loop
 else
  Response.Write "Empty Recordset"
End If
set rs=nothing
 
although ... you may need to switchout "pubs" for "maintestdb
 
what does pub mean..let me try that exact code and see if it works
thanks
 
Object or provider is not capable of performing requested operation.

Set rs = dbconn.OpenSchema(adSchemaTables, _ ->> error here
 
default data structure has "pubs" for public in sql

you may need to switch out "pubs" in the above code for "maintestdb
 
like this
Set rs = dbconn.OpenSchema(adSchemaTables, _
Array("mainttestdb", Empty, Empty, "Table"))
 
yes, althought the second closing paren may or may not be necessary
 
no it is ness coz i got an error that a ) is missing

i am getting that same error

Object or provider is not capable of performing requested operation.
 
well i broke down and installed sql7 on my workstation so i should be able to do some testing.

this is a very odd instance, and it appears you're doing a remote connection

do double your pleasure, double your fun eh ?
 
just all the hurdles to get through .. not complaining at all, i enjoy helping others.
 
Drexor, you have been going above and beyond on this post. I wish I could give you multiple stars!

Way to help out.
 
hey hey .. looky what i found in a page in never never land :

Q. Object or provider is not capable of performing requested operation.

A. The Ole DB Provider selected in the connection string is not a Database provider and does not have a table schema structure.

AND

found this, you may need to go up one level in the tutorial to find the necessary include files for it but :

 
gee thanks let me try that on monday i gtg now.. enought of this for me
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top