zuper89 Posted February 6, 2006 Share Posted February 6, 2006 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 More sharing options...
aspnetguy Posted February 6, 2006 Share Posted February 6, 2006 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 More sharing options...
zuper89 Posted February 6, 2006 Author Share Posted February 6, 2006 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)); <{POST_SNAPBACK}> Thanks :)but i need the id to be auto increment ? how do i do that ? Link to comment Share on other sites More sharing options...
aspnetguy Posted February 6, 2006 Share Posted February 6, 2006 MySQL: CREATE TABLE Customer (SID integer AUTO_INCREMENT, Last_Name varchar(30), First_Name varchar(30), PRIMARY KEY (SID)); Link to comment Share on other sites More sharing options...
zuper89 Posted February 19, 2006 Author Share Posted February 19, 2006 MySQL: CREATE TABLE Customer (SID integer AUTO_INCREMENT, Last_Name varchar(30), First_Name varchar(30), PRIMARY KEY (SID)); <{POST_SNAPBACK}> it dosn't work when I insert AUTO_INCREMENT, it works fine without :)so, if you have any other idea please say it Link to comment Share on other sites More sharing options...
zuper89 Posted February 23, 2006 Author Share Posted February 23, 2006 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 More sharing options...
beeboop717 Posted February 23, 2006 Share Posted February 23, 2006 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 More sharing options...
zuper89 Posted February 25, 2006 Author Share Posted February 25, 2006 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.<{POST_SNAPBACK}> Try this;http://www.aspwebpro.com/tutorials/asp/displaydatadb.asp Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now