trouble importing csv files to mysql from vbs and access -
I am using the following code based on Remou and Anthony Jones's previous posts and answers.
Dim db: DB = "C: \ Documents and Istelungen \ Home \ Anvandungsditain \ Bayveot 4 \ Bayvotc DB5" Daym export DIR: Export DIR = "C: \ Documents and Anstilding \ Home \ Desktop "dim Niryatfail: exportFile = NewFileName (exportDir) dim CN: set cn = CreateObject (" ADODB.Connection ") cn.Open _" provider = Microsoft.Jet.OLEDB.4.0; " & Amp; _ "Data source =" & amp; "Select" DB CNXite [text; HDR = No; Database = "& amp; Indoor & amp; _"; Varnsat = 65001]. "& Amp; Niryatfail & amp;" "the TblAuction 'export file' support functions Function NewFileName (ExportPath) Dim fs Dim NewFileTemp Set fs = CreateObject (" Scripting.FileSystemObject ") NewFileTemp =" CSV "& Amp; Year (Date) _ & amp; Month (Date) & Day (Date) & amp; Sisivi "Nufailnam = Nufailtanp end function The problem is that when I export files do, quote before the actual data on the headers in the CSV file, while being set to HDR number In my column names, which creates problems during import.
My second problem is that special characters are not saved.
I'm loading data With mysql in:
load data Local INFILE 'file' went to fix the entire region defined by ';' I have also tried without escaped by clause. The problem is that the html data in one of the fields , Which means quotes, slashes, etc .. With the reasons for incorrectly importing this data, the date field is entered in the user name field and so on. Can I properly import?
I use a scheme.ini as the following Am:
[CSV2009427.csv] ColNameHeader = no letter = 65001 format = limited (;) Coll = Article_no four width 19
and Column headers are still exported. Is it not possible to do this in a way without the need of schema.ini? Ie is able to use the script in a portable manner, where a schema can not be ini at all?
The problem I'm having, when I export the file, csv file The headers are, despite being set on the number of the HDR
I think you need to include the ColNameHeader = False .
Example:
c: \ schema.ini
[Blah.csv] ColNameHeader = false Critrset = 1252 format = CSVDelimited Coll = Pence_amount integer sql code:
select * in [text; Database = C: \]. Crap # csv coins; Note: The schema.ini file is saved in the same directory in the connection string in SQL as specified by Database .
Result: No headers.
Comments
Post a Comment