Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
IDs = Request.Form ("IDs")


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

IDs=fixQuotes(IDs)

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

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



C#
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 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
C#
Response.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
Posted
Updated 1-Apr-16 1:23am
v2
Comments

1 solution

Delete the offending line above, and write your textbox where you want the values to appear as:
HTML
<input type="text" id="IDs" value="<%=oRS("IDs")%>" />
 
Share this answer
 
v3
Comments
komokom 1-Apr-16 7:27am    
i dont understand you can give me example of it ?
Wombaticus 1-Apr-16 7:34am    
I've given you one! But I was assuming you have a textbox somewhere on the page that you want filled with the ID values. Then you do that as I said. If you want to create your textbox in the table using the Response.Write then you need to do that:
Response.Write "<input type=""text"" id=""IDs"" value="""
Response.Write oRS(IDs)
Response.Write """ />"

komokom 1-Apr-16 7:41am    
ohhhhhhhhhh now i get this ty very much :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900