------ creating a auto-numbered table with vb-script ------- 
Author Message
 ------ creating a auto-numbered table with vb-script -------

please tell me how i can insert a table into a database and the first must
be auto-numbered.
with VBScript

  dim cn,sSQL,rs,a
  a = request.form("T1")
  if a = "" then
   response.write ("false name")
  else
    set cn = server.createobject("ADODB.Connection")
    cn.open "DSN=dbs1"
    sSQL = "CREATE TABLE " & a  & " (id integer, tbla varchar50),tbl2
varchar(50))"
    response.write (sSQL)
    Set rs = cn.Execute(sSQL)
     ' tried but wont work columns blabla
cn.columns("id").properties.AutoIncrement = true
    cn.close
    set rs = nothing
    set cn = nothing
  end if

many thanks Martijn Dekker
Techid Engeneering bv




Sat, 01 Jun 2002 03:00:00 GMT  
 ------ creating a auto-numbered table with vb-script -------
Did you cut and paste this code?  There's a typo in your Create statement --
you're missing the opening paren for the tbla declaration, it should be tbla
varchar(50).

--
Rebecca Riordan
Author of Designing Relational Database Systems
http://www.cyriv.com/RDBBook.htm


Quote:
> please tell me how i can insert a table into a database and the first must
> be auto-numbered.
> with VBSCRIPT

>   dim cn,sSQL,rs,a
>   a = request.form("T1")
>   if a = "" then
>    response.write ("false name")
>   else
>     set cn = server.createobject("ADODB.Connection")
>     cn.open "DSN=dbs1"
>     sSQL = "CREATE TABLE " & a  & " (id integer, tbla varchar50),tbl2
> varchar(50))"
>     response.write (sSQL)
>     Set rs = cn.Execute(sSQL)
>      ' tried but wont work columns blabla
> cn.columns("id").properties.AutoIncrement = true
>     cn.close
>     set rs = nothing
>     set cn = nothing
>   end if

> many thanks Martijn Dekker
> Techid Engeneering bv





Sat, 20 Jul 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. ------ creating a auto-numbered table with vb-script -------

2. ------ creating a auto-numbered table with vb-script -------

3. ------ creating a auto-numbered table with vb-script -------

4. How to auto increment number in Access Table through VB form

5. VB Create Table Access Auto GUID

6. creating database with a auto-numbered tabels

7. Auto line numbering script

8. Auto Numbering in a Word Table

9. Auto Number Field in ACCESS table

10. Create tables using VB script in ASP

11. Creating table in Word document from VB Script

12. script to auto adjust font in table

 

 
Powered by phpBB® Forum Software