Bob Schneider
asked on
Can't remove single quote
Can someone tell me why this code won't replace single quotes with a pair of single quotes?
Everytime I run into a single quote it throws an ole db error...:
Dim sFldVal
Set rs = Server.CreateObject("ADODB.Recordset")
sql = "SELECT Comments FROM GrdbkRprtStdnts ORDER BY Comments"
rs.Open sql, conn, 1, 2
Do While Not rs.EOF
sFldVal = rs(0).Value
If Not sFldVal & "" = "" Then
sFldVal = Replace(sFldVal, "'", "''")
rs(0).Value = sFldVal
rs.Update
End If
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
Everytime I run into a single quote it throws an ole db error...:
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
http://forums.asp.net/t/1181193.aspx
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.