由买买提看人间百态

topics

全部话题 - 话题: newtxt
(共0页)
l**u
发帖数: 67
1
来自主题: Database版 - Please help on replacing character in VB
guys, someone please help in my code. It drives me crazy!!! wuwuwu....
The question is as following:
In a form, I have a text box named: txtName which contains customer name.
If the customer name is for example: Cindy's.
Then the txtName = "Cindy's"
Now, in my code, I need to check this txtName field. if contains the single
prime ('), I need to replace it as two single primes('')
My code is:
Dim Oldtxt as String
Dim Newtxt as String
Dim ocn as new connect
....
Oldtxt = txtName.text
Newtxt = Old
l**u
发帖数: 67
2
来自主题: Database版 - Re: Please help on replacing character i
I am using vb6. and i found out that change
Newtxt = Oldtxt.Replace(" ' ", " '' ") into
Newtxt = Replace(txtName.text, " ' ", " '' ")
And it works.
I am not very aware of VB and VB.net. Why if i use vb6, it is wrong?
Thanks

single
still
(共0页)