Solved

How can I run insert query in ASPs?

Posted on 1998-11-01
2
176 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
[X]
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
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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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
CSS style formatting? 2 62
HTML CSS and  Table design 4 70
SSL unsecure page mystery 17 47
Question about Layout 3 3
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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).

752 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