Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 17th, 2006, 09:52 AM
Registered User
 
Join Date: May 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jdsflash Send a message via Yahoo to jdsflash
Default Adding records to sql database

New to asp and databases any help is greatly apreciated!
Im having problems adding records to my database.
Am i way off? can you edit the code quick. Any good simple tutorials for adding records to a sql database
heres a link to my form.asp and confirm.asp
http://flexo.wisc-online.com/form.asp
http://flexo.wisc-online.com/confirm.asp

[code language="asp"]
  <%
DIM objRS, objConn
objConn = "Driver={SQL Server}; server=myserver;Database=mydatabase; UID=myid; PWD=mypw"
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open "tbltest", objConn
objRS.AddNew
objRS("Email") = Request.Form("Email")
objRS("FirstName") = Request.Form("FirstName")
objRS("LastName") = Request.Form("LastName")
objRS("Comments") = Request.Form("Comments")
objRS("DateContacted") = Date()
objRS.Update
%>
<p>
<%
DIM strFirstName
strFirstName = Request.Form("FirstName")
%>,<br>
</p>
<%
objRS.Close
Set objRS = Nothing
objCONN.Close
Set objCONN = Nothing
%>
[/code]

 
Old May 18th, 2006, 10:37 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

sorry, this forum is for asp.net not classic asp.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding records to db djobes31770 VB Databases Basics 3 November 27th, 2007 09:27 AM
Adding Records with VBA rohit_ghosh Access VBA 7 June 22nd, 2007 05:05 AM
Adding a column to an existing SQL database table furjaw SQL Language 10 May 17th, 2007 06:35 PM
adding multiple records Vince_421 VB Databases Basics 4 February 28th, 2007 07:22 AM
adding records sinner Classic ASP Databases 5 February 25th, 2004 06:12 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.