Add new record in SQL Server database
Hi,
I am getting an error:
Error Type:
Active Server Pages, ASP 0113 (0x80004005)
The maximum amount of time for a script to execute was exceeded. You can change this limit by specifying a new value for the property Server.ScriptTimeout or by changing the value in the IIS administration tools.
At the same time whenever I try to open SQL SERVER I am getting the message: SQL SERVER IS NOT RUNNING. ARE YOU SURE YOU WANT TO CONNECT
I wrote this script in ASP to ADD new record in SQL SERVER DATABASE
FileName: sha_BankConnection.asp
<html>
<body>
<%
dim str
str = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=Bank;Data Source=SHAILY"
%>
</body>
</html>
FileName: AddnewRecord.asp
<html>
<body>
<%
dim conn,rec, ID
set rec = server.createobject("ADODB.Recordset")
rec.open "select * from Account", str
do while not rec.EOF
response.write rec("AccountID")
response.write "<br>"
loop
ID = 1234-5678
rec.MoveLast
rec.addnew
rec("AccountID") = ID
rec("HolderName") = "Sally S. Bhat"
rec.update
rec.close
rec.open "select * from Account where AccountID = " & ID ,str
if rec.EOF then
response.write "New record not found"
else
response.write "New record is added"
end if
rec.close
set rec = nothing
%>
</body>
</html>
|