2 Replies - 243 Views - Last Post: 11 November 2012 - 11:52 PM Rate Topic: -----

#1 hiran1800  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 35
  • Joined: 06-November 10

insert data error ( cause by special alphabet) -VB2008/Access

Posted 09 November 2012 - 09:12 PM

I have problem when I save data into database ACCESS.
In textbox , I put wording : BONCAFE' , It error and can not save. Why i can not save this alpabet ' into database.

Please advice , I think that user can put everything on keyboard , how can we do this ?
Is This A Good Question/Topic? 0
  • +

Replies To: insert data error ( cause by special alphabet) -VB2008/Access

#2 headly  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 1
  • Joined: 09-November 12

Re: insert data error ( cause by special alphabet) -VB2008/Access

Posted 09 November 2012 - 09:42 PM

Try this :
Dim mytext as string
mytext = replace(textbox.text,"'","''")
Then, try to insert using your replaced text.
Good luck
Was This Post Helpful? 1
  • +
  • -

#3 hiran1800  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 35
  • Joined: 06-November 10

Re: insert data error ( cause by special alphabet) -VB2008/Access

Posted 11 November 2012 - 11:52 PM

thank you for your help.
It's work if I save data from textbox.

and If I save data come from listview , how can we do this ? Because It's not reference textbox but it reference sub Item
example : '" & .Items(i).SubItems(2).Text & "'

how to use replace about ' ?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1