Jump to content

CREATE table


zuper89
 Share

Recommended Posts

I have read the w3school Tutorials and dont get that much information to create a table with a colum that is primary key and auto increment.here is what it should be-------id - primary key and auto incrementcomment - varcharname - varcharip - varchar ?date - datetime-------and the table name should be "news + the id from an other database that is created at the same time" for an example "news14"I had done like this:(but i dont work)

ElseIf Request.QueryString("do") = "add-2" Then   navn       = Session("navn")   overskrift = Request.Form("overskrift")   del1       = Fixa(Request.Form("del1"))   del2       = Fixa(Request.Form("del2"))   objConnNY.Execute("Insert Into nyheter(ny_navn, ny_overskrift, ny_del1, ny_del2) Values('"& navn &"','"& overskrift &"','"& del1 &"','"& del2 &"')")   Response.Redirect "?vis=nyheter"mySQLNY2 = "Select * from nyheter where ny_overskrift="& overskrift &""objNY.Open mySQLNY2, objConnNYDIM objConnKOSet objConnKO = Server.CreateObject("ADODB.Connection")objConnKO.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & db3 & ";"objConnKO.Openid = objNY("ny_id")   objConnKO.Execute("CREATE TABLE news"& id &" (ko_id AUTO_INCREMENT PRIMARY, ko_kommentar varchar, ko_navn varchar(25), ko_ip varchar, ko_dato datetime)")

Thanks :)

Link to comment
Share on other sites

MySQL: CREATE TABLE Customer (SID integer, Last_Name varchar(30), First_Name varchar(30), PRIMARY KEY (SID)); Oracle: CREATE TABLE Customer (SID integer PRIMARY KEY, Last_Name varchar(30), First_Name varchar(30)); SQL Server: CREATE TABLE Customer (SID integer PRIMARY KEY, Last_Name varchar(30), First_Name varchar(30));

Link to comment
Share on other sites

MySQL: CREATE TABLE Customer (SID integer, Last_Name varchar(30), First_Name varchar(30), PRIMARY KEY (SID)); Oracle: CREATE TABLE Customer (SID integer PRIMARY KEY, Last_Name varchar(30), First_Name varchar(30)); SQL Server: CREATE TABLE Customer (SID integer PRIMARY KEY, Last_Name varchar(30), First_Name varchar(30));

Thanks :)but i need the id to be auto increment ? how do i do that ?
Link to comment
Share on other sites

  • 2 weeks later...

this is how i done it:

DIM objConnKOSet objConnKO = Server.CreateObject("ADODB.Connection")objConnKO.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & db3 & ";"objConnKO.OpenobjConnKO.Execute("CREATE TABLE news"& id &" (ko_id integer auto_increment, ko_kommentar varchar, ko_navn varchar(30), ko_ip varchar(15), ko_dato datetime, PRIMARY KEY (ko_id));")

Link to comment
Share on other sites

can somone tell me how to position a table on a page, absolute positioning? i don't know how, and i can't find it on the tutorials.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...