PDA

View Full Version : What not works?


lebronletchev
01-26-2008, 06:11 PM
Hi,

Sometimes ago this script have worked fine, but now it not works. Could you please give me a feedback?

.html file


<form method="post" name="form1" action="add.asp">
Url :<input type="text" size="100" name="url" value=""><br>
Title:<input type="text" size="100" name="Title" value=""><br>
Keyw :<input type="text" size="100" name="Keywords" value=""><br>
<textarea name="Texts" rows="10" cols="50"></textarea><br>
<input type="Submit" value="Add" name"text">
<input type="submit"name="text">
</form>


.asp file



<%@ Language = "VBScript"%>
<%


'Declare all local variables
dim conn
dim rs
dim strconn
dim strsql
strsql = ""
'set connection string to local variable-I use a DSN-less connection
strconn = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("bd1.mdb")


'build the sql statement based on the input from the form
strSQL = "INSERT INTO table1(url, title, keywords, texts)"
strSQL = strSQL & " SELECT "
strSQL = strSQL & "'" & request("url") & "' as text1,"
strSQL = strSQL & "'" & request("title") & "' as text2,"
strSQL = strSQL & "'" & request("keywords") & "' as text3,"
strSQL = strSQL & "'" & request("texts") & "' as text4"


'Set connection object


set conn = server.createobject("adodb.connection")
conn.open strconn
'Use the execute method of the connection object the insert the record
conn.execute(strSQL)
conn.close
set conn = nothing

%>
<html><head>
<title>SQL Add record example</title>
</head>

<body>
<% = "Your record has been added" %>
</body>
</html>


Thank you in advance

Lebron

Spudhead
01-30-2008, 06:08 PM
Define "not works".

You get an error message? No error message? A sense of mild dissatisfaction? Blue, acrid smoke pouring from your computer?