none
Sql with Arabic text RRS feed

  • Question

  • Dear  All

    i am working in Visual basic studio 2012,i have table in access 2007 with arabic text column ,and form visual basic with text box i want to search the word from the textbox in the table if it is there get data back ,but always get empty 

    if i use 

    select * from Allwords where word ='الاعمال'

    i get correct result ,but if i try through the textbox it is not working

    dim str as string

    str=textbox1.text

    select * from Allwords where word =N'str'

    Monday, February 8, 2016 9:48 AM

Answers

All replies

  • I assume that the select statement is in quotes:

    "select * from Allwords where word =N'str'"

    This will search for the word 'str' in your table instead of the contents of variable str. Try

      "select * from Allwords where word =N'" & str & "'"

    Matthias Kläy, Kläy Computing AG

    Monday, February 8, 2016 10:34 AM
  • If with "N" you meant to indicate that the following string is Unicode: that does not work in VBA. All strings are already Unicode under the covers.

    -Tom. Microsoft Access MVP

    Monday, February 8, 2016 1:50 PM