View Single Post
  #2 (permalink)  
Old Nov 25th, 2005, 07:55
Smokie Smokie is offline
Highly Reputable Member
Join Date: Jul 2003
Location: Ipswich, UK
Posts: 690
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Shopping cart to a databse.

Here is the code to do a database insert, of course you need to create a database first if you havent got one already...

Code: Select all
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("data.mdb") & ";"
 
strName = Request.Form("Name")
 
strQuery = "INSERT INTO tblPeople ([Name]) VALUES ('"&strName&"')"
 
Set objRS = objConn.Execute(strQuery)
Set objRS = Nothing
 
objConn.Close
Set objConn = Nothing
Reply With Quote