KyaPoocha.com

Huge Collection of Interview Questions


How to Insert the records in a database table by using ASP? 

<%
'Open a Connection with database
Dim DSN
DSN="Provider=SQLOLEDB.1; Persist security info=false; user id=sa; password=main; initial catlog=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)
%>



If you liked this question/asnwer, make sure you
Subscribe to KyaPoocha.com RSS feed!


BOOKMARK THIS : BlinkList | del.icio.us | Digg it | Furl | reddit | StumbleUpon | Yahoo MyWeb |