<%
Dim title, content
Dim connection, recordset, Baglanti
Baglanti = "Driver={SQL Server};Server={LIONEL};Database={TutorialDB};uid={test};pwd={lionel123}"
Set connection = Server.CreateObject("ADODB.Connection")
connection.Open Baglanti
title = 1
content = 2
Set recordset = connection.Execute("INSERT INTO student (name,roll) VALUES (1,1)")
connection.Close()
%>
Create a New Data Source To SQL Server
insert into database to sql server
<%
Dim title, content
Dim connection, recordset, Baglanti
Baglanti = "Driver={SQL Server};Server={LIONEL};Database={TutorialDB};uid={test};pwd={lionel123}"
Set connection = Server.CreateObject("ADODB.Connection")
connection.Open Baglanti
title = 1
content = 2
Set recordset = connection.Execute("INSERT INTO student (name,roll) VALUES (1,1)")
connection.Close()
' Set recordset = connection.Execute("INSERT INTO tb_posts (title,content,status,deleted) VALUES ('"& title &"','"& content &"','"& status &"','N');")
%>
Set recordset = connection.Execute("INSERT INTO tb_posts (title,content,status,deleted) VALUES ('"& title &"','"& content &"','"& status &"','N');")