Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HOW CAN I INSERT VALUES INTO A DATABASE

Status
Not open for further replies.

ivoestg

Programmer
Mar 21, 2001
77
0
0
PT
hello i'm new on asp and i need to insert values on a access database can you tell me how? thanks...

I'm in ivoestg@yahoo.com
 
use the SQL INSERT command

syntax: (assuming you already had setup the necessary connections to your database)

INSERT INTO table_name VALUES(Field1, Field2, ..., FieldN)

 
no i don't have anything done can you tell me all the step's??? thanks...

I'm in ivoestg@yahoo.com
 
you can also do something like this to avoid the insert sql statements if you're newer to asp
set rs = server.createobject("ADODB.recordset")
rs.open "INSERT INTO tblname", connection,2,2
rs.addnew
rs("name")=request.form("name")
rs.update

this takes the form name value and puts it into the name column at the end of the records with the addnew method and update. A lot of people use this way for many reasons but it seems like a easy way to start off before messing with doing this via the sql statement. remember that the directory where the DB is has to be writable for any insert to work. You cannot mandate productivity, you must provide the tools to let people become their best.
-Steve Jobs
admin@onpntwebdesigns.com
 
sorry that should be
rs.open "SELECT * FROM tblname", connection,2,2
not
rs.open "INSERT INTO tblname", connection,2,2
You cannot mandate productivity, you must provide the tools to let people become their best.
-Steve Jobs
admin@onpntwebdesigns.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top