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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie help

Status
Not open for further replies.

silverbeetle

Technical User
May 7, 2001
6
AU
hi all.
i'm a cold fusion user but would like to get into a bit of asp. i've had a surf around but can't find a simple example of a form inserting a value into a database. could anyone help me out with a nice clean example so i can see how it's done in asp?

thanks in advance, chris ------------------
 
Here it's
<%
Dim oConn, sConnString
Set oConn = Server.CreateObject(&quot;ADODB.Connection&quot;)
sConnString = &quot;DRIVER={Microsoft Access Driver (*.mdb)};&quot; & _
&quot;DBQ=&quot; & Server.MapPath(&quot;yourdatabasehere&quot;) & &quot;;&quot;
oConn.Open(sConnString)


SQLprocess=&quot;INSERT INTO aTable (field1, field2, field3) &quot;
SQLprocess=SQLprocess & &quot;VALUES ('&quot; & fname & &quot;', '&quot;
SQLprocess=SQLprocess & mname & &quot;', '&quot; & lname & &quot;')&quot;
Set objRSprocess=Server.CreateObject(&quot;ADODB.Recordset&quot;)
objRSprocess.Open SQLprocess,oConn,,adLockOptimistic,adCmdText

objRSprocess.close
Set objRSprocess=nothing
oConn.close
Set oConn=nothing
%>

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top