My field name is Arabic and didn't work

China☆狼群 提交于 2019-12-20 07:27:39

问题


I'm working on a database in access and I need to insert data into a table from a form when a button is clicked. Here is my code, but it didn't work.

Is the problem with my fields' names as it is Arabic?

Dim strInsert As String
Dim db As DAO.Database


strInsert = "INSERT INTO ÇáÍÖæÑ æ ÇáÇäÕÑÇÝ  [(ÑÞã ÇáãáÝ  )] values ('" & fileNO.Value & "');"

Debug.Print strInsert

db.Execute strInsert

Set db = Nothing

note: the undefined characters is the Arabic name


回答1:


There is no probleme with arabic, you've just to use utf-8 encoding when you create the Database.

CREATE DATABASE "myDataBase"
ENCODING = 'UTF8';

I've tried an insert request and it's work :

INSERT INTO test(id, data) VALUES (8888, 'أحمد');



回答2:


The simplest solution is to rename your field name temporarily to an English name (Latin letters).

Please avoid using non-Latin names in field names.



来源:https://stackoverflow.com/questions/40750789/my-field-name-is-arabic-and-didnt-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!