ASP create tables, copy table field types Appendix

Source: Internet
Author: User

ASP create tables, copy table field types Appendix


Create a table in an existing database
<% set Conn=server. CreateObject ("Adodb.connection")
Sql= "Provider=Microsoft.Jet.OLEDB.4.0;Data source=" &server. MapPath ("Book.mdb")
Conn.Open SQL
Conn.execute ("CREATE TABLE" BBB (ID autoincrement), p_id text (+), EE money,ff datetime default date (), GG guid,hh Single default 50,ii double,jj smallint,kk long,ll image,mm memo,oo yesno not null,pp tinyint,qq numeric (18,4), AA binary,b b bit,cc smallint,) ")
%>

' Another copy of Table a B (copy structure, no data)
<%
Set rs= Server.CreateObject ("ADODB. Recordset ")
Sql= "SELECT * to B from a where 1=0"
Rs.Open sql,conn,1,1
Rs.update
Rs.close
Set rs=nothing
%>
' Another copy of Table a B (including structure and data)
<%
Set rs= Server.CreateObject ("ADODB. Recordset ")
Sql= "SELECT * to B from a
Rs.Open sql,conn,1,1
Rs.update
Rs.close
Set rs=nothing
%>

12. Create a new database and create a new table
<%
' First create a database file
Set Conn=server.createobject ("Adox.catalog")
Conn.create "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data source=" &server.mappath ("Lifeda1.mdb")
%>
<%
' Create the appropriate table in this database
Set Rs=server.createobject ("Adox.table")
' The table name
Rs.name= "AAAA"
' This table field (field type See related appendix)
Rs.columns.append "id", 3
Rs.columns.append "Liuyan", 203
Rs.columns.append "DT", 7
Conn.tables.append RS
Set rs=nothing
%>
The form is now complete. Hope to be of help to you.
Field type Appendix
203 Notes
7th Issue/Time
1282 Binary
11 bool
6 currency
133 Date
134 Time
135 Date and time
5 Double Precision
4 Single Precision
3 numbers
2042 binary
202 string

ASP create tables, copy table field types Appendix

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.