Results 1 to 5 of 5

Thread: inserting unicode text to mysql database

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2001
    Location
    India
    Posts
    117

    inserting unicode text to mysql database

    Sir,
    i am using using vb6 and mysql. i am using vb6 to enter datas to mysql database. my problem is i can't insert unicode text to mysql database. i am using microsoft form control's text box to enter unicode (vb6's textbox doesnot support unicode. isn't it?) when i insert textbox contents to mysql database it shows only question marks. please help me.... below is my code.....

    Set conn = New ADODB.Connection
    conn.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};" _
    & "SERVER=localhost;" _
    & "DATABASE=2007_news;" _
    & "UID=root;" _
    & "PWD=;" _
    & "OPTION=" & 1 + 2 + 8 + 32 + 2048 + 16384
    conn.ConnectionString = GloConnectionString
    conn.CursorLocation = adUseClient
    conn.Open
    rs.Open "INSERT INTO news (news_id, news_content) values(100, '" & TextBox1.Text & "')", conn
    conn.Close


    raman

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: inserting unicode text to mysql database

    What is the unicode that you are trying to insert? I see a numeric value of 100 and a string that is sitting in Text1.Text.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Mar 2001
    Location
    India
    Posts
    117

    Re: inserting unicode text to mysql database

    sir,
    the contents in textbox1.text is unicode content....
    ram

  4. #4
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: inserting unicode text to mysql database

    Thread moved to Database Development forum

    I suspect that this is similar to the issue when using unicode with SQL Server, where you need to explicitly specify within the SQL that the text is unicode.

    For SQL Server, you add an N before the quotes (eg: values(100, N'your text' ), but I'm afraid I don't know what MySQL uses.. you should check the documentation.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Mar 2001
    Location
    India
    Posts
    117

    Re: inserting unicode text to mysql database

    Sir,
    it is not working for mysql. it works for sql server.... please help me....

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