Is it possible to create a new table within ASP?

Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: Is it possible to create a new table within ASP?

  1. #1
    Join Date
    Dec 1969
    Posts
    33

    Default Is it possible to create a new table within ASP?

    Just wondering if your could create an entirely new table from a recordset or some other way from ASP

  2. #2
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: Is it possible to create a new table within ASP?

    Yes, it is possible. You can use SQL to create a table.<BR><BR>CREATE TABLE tablename<BR>(<BR>Columnlist/properties<BR>)<BR><BR>You should read some documentaion on it (SQL Books on-line, if you have them) Here is an example, this will create an empty table named test with two columns, Name, a varchar(50) and age, and int.<BR><BR>&#060;%<BR>&#039Establish Connection to DB using ADODB.Connection<BR>Dim conn<BR>Set conn = Server.CreateObject("ADODB.Connection")<BR>conn.Op en "DSN=blah"<BR><BR>Dim strSQL<BR>strSQL = "CREATE TABLE test (name varchar(50), age int)"<BR>conn.Execute strSQL<BR>&#037;&#062;<BR><BR>Happy Programming!<BR>

  3. #3
    allenharrison@slb.com Guest

    Default RE: Is it possible to create a new table within AS

    How do I declare one of the fields to be Autonumber for use as a Access primary indexing field?<BR><BR>Thanks

  4. #4
    David L. Penton Guest

    Default RE: Is it possible to create a new table within AS

    Consider this SQL statement (for MS Access)<BR><BR>CREATE TABLE newTable(<BR> id counter,<BR> textFld text (50),<BR> numberFld int,<BR> curdate datetime<BR>)<BR><BR>There you go!!!


  5. #5
    Join Date
    Dec 1969
    Posts
    3

    Default RE: Is it possible to create a new table within AS

    i think u can do it by simply passing the create statement in a sqlstring and executing the query .<BR><BR>dim con<BR>dim rs <BR>dim strsql<BR><BR>con = server.createobject("adodb.connection")<BR>rs = server.createobject("adodb.recordset")<BR>strsql = "create table xxx...."<BR>con.open<BR>rs.open strsql,con<BR><BR>I think the above lines of code will solve it.<BR>

  6. #6
    Ed Guest

    Default RE: Is it possible to delete a table within ASP?

    Is the Sql command to delete a table simply "Delete TABLE test" ?

  7. #7
    Adrian (adrian@seanet.com Guest

    Default How does the user name the table here?

    How can we modify this so that the user has the opportunity to enter the name of the table, instead of it being simply "test"?

  8. #8
    Hakan Eskici Guest

    Default RE: Is it possible to delete a table within ASP?

    Syntax is:<BR>DROP TABLE tablename<BR><BR>You may download TableEditoR and look into the source code for table structure modification SQL statements. It&#039;s at:<BR>http://www.2enetworx.com/dev/projects/tableeditor.asp

  9. #9
    fth Guest

    Default RE: Is it possible to create a new table within AS

    7i9z

  10. #10
    Join Date
    Dec 1969
    Posts
    2,849

    Default ASPFAQs.com, FAQ # 8

    Yes, I know this is an outdated thread, but I thought I&#039;d post this anyhow:<BR><BR>Check out this FAQ:<BR><BR>How do you create a database table through a SQL statement (via an ASP page, perhaps)?<BR>http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=8<BR><BR>You can see a listing of database related FAQs at:<BR>http://www.aspfaqs.com/aspfaqs/ShowCategory.asp?CatID=8<BR><BR>Happy Programming!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •