关于数据库(存储过程、安全问题及数据模块)和文件类型输入框的问题?谢了,分不够再加!
1、如何将数据库中的一个字段值赋给<input type="file">的输入框作为初始值,允许用户自行修改?为何通过右键设置“值”没有用,像一般的输入框只要在“初始值”那设置即可,这个好像没有?
2、请教我想将下列代码所实现的功能由存储过程来实现,该如何操作?存储过程究竟该在什么时候用呢?能举例最好!
set conn=server.createobject("ADODB.connection")
Connstr="Provider=SQLOLEDB;Data Source=127.0.0.1;UID=sa;PWD=111;DataBase=xhyy"
conn.open connstr
set RS= conn.Execute("select id from newsinfo where " _
& "id = '" & trim(Request.Form("id")) & "'")
if RS.EOF then
conn.Execute "insert into newsinfo
(id,title,author,createtime,modifytime,keywords,src) values (" _
& "'" & Request.Form("id") & "', " _
& "'" & Request.Form("title") & "', " _
& "'" & Request.Form("author") & "', " _
& "'" & now() & "', " _
& "'" & now() & "', " _
& "'" & Request.Form("keywords") & "', " _
& "'" & Request.Form("src") & "' )"
response.Write "insert successfully"
else
response.Write "insert failed"
end if
rs.close
set rs=nothing
3、 下面的连接字符串是不是存在安全隐患问题,如何解决呢???另外,该段连接代码可否写入类似“数据模块”的共享模块中,让所有调用此数据库连接都用这个数据模块即可?
set conn=server.createobject("ADODB.connection")
Connstr="Provider=SQLOLEDB;Data Source=127.0.0.1;UID=sa;PWD=111;DataBase=xhyy"
conn.open connstr