c-- styles for logos and headline links do not modify internet, red, or black styles -->

Intranet Journal   Earthweb  
Events Jobs Premium Services Media Kit Network Map E-mail Offers Vendor Solutions Webcasts

   Intranet Journal Subjects
Search Earthweb

Privacy Policy



internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

internet commerce
Be a Commerce Partner
















 

[ Home | Discussion Forum | How Do I... | Lotus Notes Intranets | Microsoft SharePoint | Products | Shopping  ]

free news!

Adding Records to a Database using SQL


By Steve Schofield

My Favorite Car:

My favorite color:

Comments about this car

Here is the code to this example

<% @language="vbscript" %>

<%

'Forces you to explicitly declare all local variables. This is a good way to code

option explicit
dim rs
dim conn
dim strconn
dim strsql

strconn= "Driver={SQLServer};SERVER=127.0.0.1;UID=loginid;PWD=password;DATABASE=somename_db"

set conn = server.createobject("adodb.connection")

conn.open strconn
strsql = "select * from tblTextArea"
set rs = conn.execute(strsql)

%>

<html>
<head>

<title>Writing out text Areas</title>

</head><body>

<form method="POST" action="textarea.asp">

<p>My Favorite Car: <input type="text" name="txtFavoriteCar" size="20" value="<% = rs("FavoriteCar") %>"></p>

<p>My favorite color:<input type="text" name="txtFavoriteColor" size="20" value="<% = rs("FavoriteColor") %>"></p>

<p>Comments about this car</p>

<p><textarea rows="5" name="S1" cols="44"><% = rs("Comments") %></textarea></p>

</form>

</body>
<%
conn.close
set conn = nothing

%>
</html>

 




Next: Simple ASP Chat

Previous: Adding Records to a Database using SQL Index: Active Server Pages\IIS


The Author
Steve Schofield has been working with computers for over three years and for the last year doing web development. "I'm not one of these whizkids that was born with a keyboard in their hands. I have struggled, scratched and clawed my way to learn this stuff. not in college either,!). Once I discovered ASP pages and haven't looked back. Using ASP, A.D.O., vbscript. I have been able to access all kinds of databases (DB2, Sybase, MS Sql Server 6.5/7.0 & Access97)."



[print version of this page]

Of Interest
· Post and answer questions with the experts at Intranet Journal's discussion Intranet Discussion Forum, the eXchange.