Author: tonny reprint please show the source: http: //www.weiw.com
Database structure operation. Adapt to common databases such as Access, SQL Server.
1. establish connection. Can be connected via ODBC or OLEDB. Set gObjDC = Server.CreateObject ( "ADODB.Connection") dim strconn, myDSNmyDSN = "test" strconn = "DSN =" & myDSN & "; uid = sa; pwd =" 'strconn = "Provider = SQLOLEDB.1; Persist Security Info = True; user ID = sa; initial catalog = meisha; data source = tonny "gobjdc.connectionstring = strconngobjdc.open
2. Display all tables set gobjrs = gobjdc.openschema (adschematables) do while not gobjrs.eofif gobjrs.fields ("Table_Type") = "Table" and left ("Table_Name"), 4) <> "msys" THEN 'Don't have to display system tables to response.write "
3. New Table
field count: < BR>
FORM>
DefineTable.asp Main Source MYFIELDCOUNT = Request.form ("Field_count")