开发者

ASP - Insert French Character in Access Database

I want to insert french character开发者_Go百科s in an Access database using ASP.

Can you please suggest me what can i do??

Many Thanks

Shaheen


Here is half the answer

If you know the ASCII code of the french character then you can use the chr() function e.g.

INSERT INTO TestTable ( Field1 ) VALUES ( Chr(133));

Here is a list of relevant ascii codes french characters

[EDIT] A rather more complete example below

Sub Test_ASCII()
    Dim strSQL As String, strName As String
    strName = "Andr" & Chr(133) 'Good French Name
    strSQL = "INSERT INTO TestTable ( Field1 ) VALUES ('" & strName & "');"
    DoCmd.RunSQL strSQL
End Sub

Query runs fine, but the French "e" is not displaying correctly. Probably my setup -- refer comment below

I only have access 2002, perhaps later version have support for UFT-8 or UNICODE?


  1. Do make sure to use nvarchar() (UTF-16) instead of varchar() (ASCII or something).
  2. Make sure you don't apply any encoding except for escaping, on insertion. You just don't want to insert HTML values or something into the database.
  3. It's very important that you don't do any decoding on retrieving. What goes in goes out (minus the escaping, of course).
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜