本文介绍了如何使用ASP变量从ASP更改表单输入文本数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

IDs = Request.Form ("IDs")





函数fixQuotes(theString)

fixQuotes = Replace(theString,','')

结束功能



ID = fixQuotes(ID)





Function fixQuotes(theString)
fixQuotes=Replace(theString, "'", "''")
End Function

IDs=fixQuotes(IDs)

Set oConn = Server.CreateObject("ADODB.Connection")

oConn.Open  "Driver={Microsoft Access Driver (*.mdb)};" & _
            "Dbq=" & Server.MapPath("db\Register.mdb") & ";" & _
            "Uid=admin;" & _
            "Pwd=;"










mySQL = "SELECT * FROM customer WHERE IDs = '" & IDs & "' ;"

Set oRS = oConn.Execute (mySQL)
Response.Write("<table align=center cellpadding=5 cellspacing=0 border=1 >")
Do Until oRS.EOF
    Response.Write "<tr>"
    Response.Write "<td>"
    Response.Write oRS.Fields("address").Value
    Response.Write "</td>"
    Response.Write "<td>"
    Response.Write oRS.Fields("Bdate").Value
    Response.Write "</td>"
    Response.Write "<td>"
    Response.Write oRS.Fields("firstname").Value
    Response.Write "</td>"
    Response.Write "<td>"
    Response.Write oRS.Fields("lastname").Value
    Response.Write "</td>"
    Response.Write "<td>"
    Response.Write oRS.Fields("email").Value
    Response.Write "</td>"
    Response.Write "<td>"
    Response.Write oRS.Fields("sex").Value
    Response.Write "</td>"
    Response.Write "<td>"
    Response.Write oRS.Fields("phone").Value
    Response.Write "</td>"
    Response.Write "<td>"
    Response.Write oRS.Fields("IDs").Value
---> Response.Write.Form("IDs").Value = oRS.Fields("IDs").Value
    Response.Write "</td>"
    oRS.MoveNext
    Response.Write "</tr>"
Loop
Response.Write("</table>")


oRS.Close
Set oRS = Nothing

oConn.Close
Set oConn = Nothing







i想要改变字段中的id通过使用asp变量形式使用SQL变量使用sql查询因为我搜索这个id它的woeking但是当它转到这行时




i want to change the field id in the form by using asp variable
i using sql query because i search this id its woeking but when its go to this line

Response.Write.Form("IDs").Value = oRS.Fields("IDs").Value





i得到错误全部



我怎么能这样做?



我尝试了什么:



i尝试了这个选项,但我也得到了错误

说不要太多变数而且它不认识对象:



Response.Write.Form(IDs)。Value = oRS.Fields(IDs)。Value



Response.Form(IDs)。值= oRS.Fields(IDs)。值



表格(ID)。值= oRS.Fields (ID)。价值



Request.Form(IDs)。Value = oRS.Fields(IDs)。Value



Request.Write.Form(IDs)。Value = oRS.Fields(IDs)。Value



i got error all the

so how can i do that?

What I have tried:

i tried this option but i got error too
that say dont much variable and it dont recognize the object :

Response.Write.Form("IDs").Value = oRS.Fields("IDs").Value

Response.Form("IDs").Value = oRS.Fields("IDs").Value

Form("IDs").Value = oRS.Fields("IDs").Value

Request.Form("IDs").Value = oRS.Fields("IDs").Value

Request.Write.Form("IDs").Value = oRS.Fields("IDs").Value

推荐答案

<input type="text" id="IDs" value="<%=oRS("IDs")%>" />


这篇关于如何使用ASP变量从ASP更改表单输入文本数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 21:26