Results 1 to 4 of 4

Thread: Unicode & Database

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2001
    Location
    shiraz
    Posts
    163

    Question Unicode & Database

    Hi guys
    I was working on Unicode for a while and finally I learned how to use it in order to show Chinese, Arabic, and Indian etc. I show them on “MS forms 2.00” which is consisted of controls that support Unicode. Now I can display and type any language in them. BUT a few problems:
    1.How can I store a Unicode string in to a database (a mdb for example)?
    2. how can I restore Unicode strings form a db?
    As an Unicode character is a 2 byte one and a simple ASCII char is 1 byte. a database string field refuses to accept my Unicode string.
    Any suggestions? I’m thinking of using the binary field type but it is limited and also I think it will work very slowly besides I’ll have to say goodbye to SQL queries.

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Aug 2001
    Location
    shiraz
    Posts
    163

    Re: Unicode & Database

    any idea??

  3. #3
    New Member
    Join Date
    Jan 2011
    Location
    Pakistan
    Posts
    7

    Thumbs up Re: Unicode & Database

    it only matter with following two lines:

    <% @ codepage=65001 %>
    and
    OpenSchema

    This is ASP vbscript

    Here is the Code:

    Code:
    <% @ codepage=65001 %>
    <%
    Dim  f
    Response.CharSet = "utf-8"
    	Set cnnDB = CreateObject("ADODB.Connection")
    	
    	strDBPath=server.MapPath ("TntjKuwait.mdb")
    	
    	With cnnDB 
    	   .Provider = "Microsoft.Jet.OLEDB.4.0" 
    	   .Open strDBPath 
    	End With
    
    
    	Set rstList = cnnDB.OpenSchema(4)
    	Set rstList = cnnDB.Execute("SELECT * FROM tblfirst")
    	Set f = rstList(1)
    	Do Until rstList.EOF
    		Response.Write f
    		Response.Write "<BR>"
    		rstList.MoveNext
    	Loop
    	
    	rstList.Close
    	cnnDB.Close
    %>
    I included 4 different language (Arabic, Persian,Urdu & tamil )strings in Database field to check Unicode functionality.

    Al-Qaim
    Attached Files Attached Files

  4. #4
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: Unicode & Database

    Jet 4.0 databases handle Text and Memo fields as Unicode naturally. Only ancient Jet 3.5 ("Access 97") and earlier uses ANSI.

    The Forms 2.0 library has numerous restrictions on its use is was never approved for use in VB6 programs.

    I have no idea how an ASP example has anything to do with this subject at hand.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width