Graeme McGilvray
asked on
How do I insert a value (including commas) into a text field from ASP Classic into Access
Hi EE Brainstrust and thanks in advance for your help
I am having some issues with looking for code or trying to figure out how to insert a value into a text field which has a comma in it, can anyone help?
I am having some issues with looking for code or trying to figure out how to insert a value into a text field which has a comma in it, can anyone help?
It's the same as with a value without comma, e.g. something like:
See also: ASP Classic - Using Parameterized Queries.
Set cmd = server.CreateObject("ADODB.Command")
cmd.ActiveConnection = yourConnection
cmd.CommandText = "INSERT INTO yourTable ( keyColumn1, valueColumn2 ) VALUES ( ?, ? );"
cmd.CommandType = adCmdText
cmd.Parameters.Append cmd.CreateParameter("@keyColumn1, adInteger, adParamInput, 4, key)
cmd.Parameters.Append cmd.CreateParameter("@valueColumn2, adVarchar, adParamInput, 20, value)
cmd.Execute
See also: ASP Classic - Using Parameterized Queries.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Sample code:
Open in new window