TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ye Htut
NA
120
34.4k
insert data to DB with MS SQL using Classic ASP
May 5 2014 1:09 AM
first I made "connection.asp"
the codes in "connection.asp" file are as follows
<%
Dim conn
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Provider=SQLOLEDB; Data Source = (local); Initial Catalog = Test; User Id = sa; Password=as"
If conn.errors.count = 0 Then
Response.Write "Connected OK"
End If
%>
then I made "author.asp". The following code are in "author.asp"
<!DOCTYPE html>
<!--#include file="connection.asp" -->
<html>
<head>
<title></title>
</head>
<body>
<form method="post" action="author.asp">
<label>AuthorID</label>
<input type="text" name="aid"><br>
<label>Author Name</label>
<input type="text" name="aname"><br>
<input type="submit" value="Register">
</form>
<%
dim aid,aname,objs
aid=Request.form("aid")
aname=Request.form("aname")
Set objdb=conn()
query = "INSERT INTO author (aid,aname) VALUES ('"& aid &"','"& aname &"')"
Set objs = objdb.Execute(query)
Response.Redirect ("thankyou.asp")
%>
</body>
</html>
the code can't run. I think, there may be error in "author.asp". So, Plz help me
Reply
Answers (
1
)
Checkbox columns in DataGridView
how to refresh form in MDI forms when form load