Hi All,
I am trying to write some info to an Access Db, it all works fine until the data it's adding contains a ' (single apostrophe!). It then bombs out because now the command line is fragmented.
I know in perl (and other languages I believe) you can use place holders to get around this issue where you substitute a ? and apply the data after the command line and as if by magic its all inserted correctly!
How can I do this in VB? The line of code I am using that is relevant is:
As I mentioned above, this works fine until the curfile variable contains a ' (for example - I'm not liking this)
TIA!
I am trying to write some info to an Access Db, it all works fine until the data it's adding contains a ' (single apostrophe!). It then bombs out because now the command line is fragmented.
I know in perl (and other languages I believe) you can use place holders to get around this issue where you substitute a ? and apply the data after the command line and as if by magic its all inserted correctly!
How can I do this in VB? The line of code I am using that is relevant is:
Code:
With cmdCommand
.ActiveConnection = conConnection
.CommandText = "SELECT * FROM library WHERE URL = '" & curfile & "';"
.CommandType = adCmdText
End With
As I mentioned above, this works fine until the curfile variable contains a ' (for example - I'm not liking this)
TIA!