I'm having a problem updating my Access 2002 db using an ASP variable whose value is provided from a form text box.
If I simply use the following, the db is updated correctly with the number 5.
Set conn = server.createobject("adodb.connection")
conn.connectionstring = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=C:\tradersreportsdata\reportevents.mdb"
conn.Open
Set rs=Server.CreateObject("ADODB.recordset")
rs.open "UPDATE reports SET ActVal = '5' WHERE rID = 38;", conn
conn.close
Set conn = Nothing
However, if I use this:
Set conn = server.createobject("adodb.connection")
conn.connectionstring = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=C:\tradersreportsdata\reportevents.mdb"
conn.Open
Set rs=Server.CreateObject("ADODB.recordset")
rs.open "UPDATE reports SET ActVal = 'ActVal38' WHERE rID = 38;", conn
conn.close
Set conn = Nothing
where ActVal38 is the variable name I want to update the database with, it just puts the characters ActVal38 into the db.
Can someone tell me what I'm doing wrong?
Regards
If I simply use the following, the db is updated correctly with the number 5.
Set conn = server.createobject("adodb.connection")
conn.connectionstring = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=C:\tradersreportsdata\reportevents.mdb"
conn.Open
Set rs=Server.CreateObject("ADODB.recordset")
rs.open "UPDATE reports SET ActVal = '5' WHERE rID = 38;", conn
conn.close
Set conn = Nothing
However, if I use this:
Set conn = server.createobject("adodb.connection")
conn.connectionstring = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=C:\tradersreportsdata\reportevents.mdb"
conn.Open
Set rs=Server.CreateObject("ADODB.recordset")
rs.open "UPDATE reports SET ActVal = 'ActVal38' WHERE rID = 38;", conn
conn.close
Set conn = Nothing
where ActVal38 is the variable name I want to update the database with, it just puts the characters ActVal38 into the db.
Can someone tell me what I'm doing wrong?
Regards