Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

How can I run insert query in ASPs?

Posted on 1998-11-01
2
168 Views
Last Modified: 2010-04-09
I want to develop a database using Active Server Pages.I want to give input through HTML form.Database is in MsAccess.
0
Comment
Question by:ali123
2 Comments
 

Author Comment

by:ali123
ID: 1839345
Please Help me...
0
 
LVL 28

Accepted Solution

by:
sybe earned 100 total points
ID: 1839346
<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "DSN=MyDatabase"

' ========================================
' example 1, using an "insert" sql statement

strSQL = "INSERT into TableName (field1,field2) values ('test','test')"
Conn.Execute(strSQL)

' ===================================
' example 2, using an updatable recordset

Set RS = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM TableName"
RS.Open strSQL, Conn, 1, 3

RS.AddNew
RS("field1") = "test"
RS("field2") = "test"
RS.Update
RS.Close

%>
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Changing Two Areas of a Page 5 27
Just need a little help with this header height please 10 44
Load data upon clicking a button 8 35
Selected in an option list 13 21
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question