Search found 6 matches

by Denker
Mon 09 Apr 2012 10:10
Forum: dotConnect for MySQL
Topic: Get Trash Instead Umlaut letter from DB.
Replies: 10
Views: 3502

sry that was my fault, i used streamreader and streamwriter to edit the File, and there was my fault, that the streamreader and streamwriter used a wrong encoding text. now it`s all ok.

I edit the file, so i can replace or ignore duplicate id, and now it`s ok.

Thank you

Code: Select all

Public Function tabellensync(ByVal table As String, Optional ByVal whereklausel As String = "", Optional ByVal auswahl As String = "*", Optional ByVal ignore As String = " IGNORE ") As Boolean
        Dim sr As System.IO.StreamReader
        Dim sw As System.IO.StreamWriter
        Dim neu As String
        Dim datei As String
        datei = "C:\ticket_sync\" & table & Now.Ticks & ".sql"
        tabellensync = True
        dumpsave.IncludeDrop = True
        dumpsave.GenerateHeader = True
        dumpsave.Connection = conentfernt
        dumpsave.UseExtSyntax = True
        dumpsave.QuoteIdentifier = True
        dumpsave.BackupQuery("select " & auswahl & " from " & table & " " & whereklausel, datei)
        sr = New System.IO.StreamReader(datei)
        neu = sr.ReadToEnd
        sr.Close()
'with ignore i ignore duplicate id`s and with the second i Replace duplicate
then is ignore = " REPLACE " 
        If ignore = " IGNORE " Then
            neu = Replace(neu, "INSERT INTO", "INSERT " & ignore & " INTO")
        Else
            neu = Replace(neu, "INSERT INTO", ignore & " INTO")
        End If

        sw = New System.IO.StreamWriter(datei)
        sw.Write(neu)
        sw.Close()
        conlokal.open()
 AddHandler dumpeinspiel.[Error], New Devart.Common.ScriptErrorEventHandler(AddressOf dump_error)
        dumpeinspiel.Connection = conlokal
        dumpeinspiel.Restore(datei)
        My.Computer.FileSystem.DeleteFile(datei)
        Return 1
    End Function
by Denker
Wed 04 Apr 2012 15:11
Forum: dotConnect for MySQL
Topic: Get Trash Instead Umlaut letter from DB.
Replies: 10
Views: 3502

Hi,

show variables like 'char%'
charset latin1
charsets latin1 big5 czech euc_kr gb2312 gbk latin1_de sjis tis620 ujis dec8 dos german1 hp8 koi8_ru latin2 swe7 usa7 cp1251 danish hebrew win1251 estonia hungarian koi8_ukr win1251ukr greek win1250 croat cp1257 latin5

if i try unicode = true i got an exception, charset differs from the server, set charset to latin1.

thanks
Denker
by Denker
Tue 03 Apr 2012 18:17
Forum: dotConnect for MySQL
Topic: Get Trash Instead Umlaut letter from DB.
Replies: 10
Views: 3502

special german chars umlaut

Hello,

i try this
http://www.devart.com/forums/viewtopic.php?t=23624
but it doesn`t help with mysqldump or mysqlscript.

I use mysqldump to backup a file in the file all characters ok. I can connect to the same server and try to restore and the letters are not ok.

Mysqlloader have no problem.

I use Mysql Server Version 4.0.24.

Thank you for help
by Denker
Tue 03 Apr 2012 14:59
Forum: dotConnect for MySQL
Topic: Mysqlloader conflictoptions doesn`t work
Replies: 1
Views: 1214

Mysqlloader conflictoptions doesn`t work

Hi, i have this code

Code: Select all

Public Property options As New MySqlLoaderOptions

sub test ()
        Dim cmd As New MySqlCommand
        Dim datatable As New MySqlDataTable
        Dim mloader As New MySqlLoader
        options.ConflictOption = MySqlLoaderConflictOption.Replace
        cmd.Connection = con
        cmd.open
        cmd.CommandText = "Select " & auswahl & " from " & table & " where id > 10 "
        datatable.SelectCommand = cmd
        datatable.Fill()
        mloader.Connection = conlokal
        mloader.TableName = table
        mloader.Open()
        mloader.CreateColumns()
        mloader.LoadTable(datatable)
        mloader.Close()
end sub
Con and conlokal are different Server.
Createcolumns and replace doesn`t work with loadtable, i will replace the conlokal database with the Data from con.

Can this the Mysqlloader class?
Thanks
Denker
by Denker
Thu 02 Feb 2012 15:06
Forum: dotConnect for MySQL
Topic: MYSQLDUMP replace or ignore duplicate
Replies: 2
Views: 3419

tank you

Thank you, but i have another fix for the Problem.

Code: Select all

dump.UseExtSyntax = True
dump.backup(datei)
sr = New System.IO.StreamReader(datei)
       neu = sr.ReadToEnd
            sr.Close()
            neu = Replace(neu, "INSERT INTO", "INSERT IGNORE INTO")
            sw = New System.IO.StreamWriter(datei)
            sw.Write(neu)
       sw.Close()
dump.restore(datei)
I only replace "INSERT INTO" to "INSERT IGNORE INTO" and Dump.restore works without any error.

Thanks
Denker
by Denker
Thu 19 Jan 2012 11:34
Forum: dotConnect for MySQL
Topic: MYSQLDUMP replace or ignore duplicate
Replies: 2
Views: 3419

MYSQLDUMP replace or ignore duplicate

Hi,

I Want to backup only new Data from MYSQLDUMP, it works but sometimes old Rows are in the Dump, then i got an error, with duplicate keys.
Can i restore a MYSQLDUMP and ignore or replace duplicate Keys?


Thanks
Denker