Signup · Login
Stardeveloper.com  
Home · Tutorials · Forums · Web Hosting Plans · Faisal Khan's Blog · Contact
Forums : ASP : ADO/ODBC : I want to add record through Form Signup · Login
Author Thread
I want to add record through Form
Posted in tutorial: Adding records to the database with ASP
·  snips
User
Joined: 7 Jan 2003
Total Posts: 4
I want to add record through Form
Posted: 7 Jan 2003
i need help that how insert statement work if i want to get entry from user and insert into database ..
thanks
RIz

Rizwan Haider
·  catt
User
Joined: 25 Jun 2003
Total Posts: 1
add record
Posted: 25 Jun 2003
u can try this:



set objConn = Server.CreateObject("ADODB.Connection")
strConnection = "Data Source = yourDSN;"
strConnection = strConnection & "User ID = username; Password = yourPassword;"

objConn.open strConnection

set objRS = server.CreateObject("ADODB.Recordset")
set objRS.ActiveConnection = objConn

fldmid = request("mid")
fldtopic = request("topic")
fldauthor = request.Cookies("user")
fldmessage = request("reply_message")

strQ = "INSERT INTO messages (author, topic, message, date_entered, status, message_parent_id) VALUES('"&fldauthor&"','"&fldtopic&"','"&fldmessage&"', '"&now()&"','reply','"&fldmid&"')"
objConn.Execute strQ

Users Who Have Visited This Thread In Last 24 Hours
3 Visitors

Login
UserName Or Email Address:       Password:       Auto-Login:    
· Create New User Account
· Send Forgotten Password by Email
 
© 1999 - 2009 Stardeveloper.com, All Rights Reserved.