|
-
Sep 24th, 2007, 02:00 AM
#1
Thread Starter
Lively Member
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
-
Sep 24th, 2007, 05:47 AM
#2
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.
-
Sep 24th, 2007, 10:37 AM
#3
Thread Starter
Lively Member
Re: inserting unicode text to mysql database
sir,
the contents in textbox1.text is unicode content....
ram
-
Sep 24th, 2007, 10:52 AM
#4
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.
-
Sep 24th, 2007, 03:21 PM
#5
Thread Starter
Lively Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|