Saturday 10 December 2011

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)
%>

No comments:

Post a Comment