ผมนำ code จาก thai create ไปทดสอบ ASP SQL Server List Table Properties
Code (ASP)
<%
Dim Conn,strSQL,objRec,arrField
Set Conn = Server.Createobject("ADODB.Connection")
Conn.Open "Driver={SQL Server};Server=.\SQLEXPRESS;Database=cpabc_com;UID=acb_db;PWD=abc1;"
strSQL = "SELECT * FROM [th_AboutUs]"
Set objRec = Server.CreateObject("ADODB.Recordset")
objRec.Open strSQL, Conn, 1,3
Response.write "<b>Table customer have "& objRec.Fields.Count &" Fields.</b><br>"
For Each arrField In objRec.Fields
Response.write arrField.Name & "<br>"
Next
objRec.Close()
Conn.Close()
Set objRec = Nothing
Set Conn = Nothing
%>
แต่พอลอง run ผ่านเว็บดูมันขึ้น Errror
Microsoft OLE DB Provider for ODBC Drivers error '80040e37'
[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'th_AboutUs'.
/listtest.asp, line 14