Home > front end >  In the asp environment, need to copy table aa structure to bb in the table, who can tell why three S
In the asp environment, need to copy table aa structure to bb in the table, who can tell why three S

Time:10-01

<%
STable="aa" 'source table
TTable="bb" 'new table, it is necessary to create
Set the rs=Server. CreateObject (" ADODB. You ")
'SQL="Select * Into" & amp; TTable&" From "& amp; STable
'SQL="Select top 0 * Into" & amp; TTable&" From "& amp; STable
'SQL="create table" & amp; TTable&" As select * from "& amp; STable
SQL=sql&" Where 1=0 "

Rs. The open SQL, conn, 1, 1
Rs. Update
Rs. Close
Set the rs=nothing
%>
Is the access database, connection file is conn. Inc, there is no problem

CodePudding user response:

Two table structure? I have been a table of data backup to two table structure

CodePudding user response:

1 don't return the records set does not need to use the rs, directly conn. Execute SQL
2 to create a table structure should use ADOX objects (ADO Extensions for DDL and Security)

CodePudding user response:

# 2
Table structure for "aa" copied from the source table

CodePudding user response:

# 3
Using conn. Execute SQL also tested, but also pass it!
  •  Tags:  
  • ASP
  • Related