ASP Programming Question:
Download Job Interview Questions and Answers PDF
How to insert the records in a database table by using ASP?
Answer:
<%
'Open a Connection with database
Dim DSN
DSN="Provider=SQLOLEDB.1; Persist security info=false; user id=sa; password=main; initial catalog=database name Data Source=localhost"
set objCon=Server.CreateObject("ADODB.Connection")
objCon.Open DSN
%>
<%
'Get the Query
Dim SQL
SQL="insert into tablename values('a','b','c')"
%>
<%
'Insert Into Database
objCon.Execute(SQL)
%>
'Open a Connection with database
Dim DSN
DSN="Provider=SQLOLEDB.1; Persist security info=false; user id=sa; password=main; initial catalog=database name Data Source=localhost"
set objCon=Server.CreateObject("ADODB.Connection")
objCon.Open DSN
%>
<%
'Get the Query
Dim SQL
SQL="insert into tablename values('a','b','c')"
%>
<%
'Insert Into Database
objCon.Execute(SQL)
%>
Download ASP Programming Interview Questions And Answers
PDF
Previous Question | Next Question |
What is the command to display characters to the HTML page? | What is http header? |