Results 1 to 5 of 5
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts
    .... into text file have the header of fileds, is possible to NO import header of each field and import from the second line of text file?

    How to modify this string:
    cnDB.Execute "INSERT INTO [StarData] " _
    & "SELECT * FROM [Text;Database=" & strTextFolder & "].[" _
    & StarsTextFile & "]", _
    lngImported, _
    adCmdText Or adExecuteNoRecords

    i have see in the forum existsis the option YES/NO but have difficult to arrange the code...

    i use this ini file but the header of fileds are imported into first line of table????

    Print #intFile, "[" & StarsTextFile & "]"
    Print #intFile, "MaxScanRows=1"
    Print #intFile, "Format=Delimited(;)"
    Print #intFile, "ColNameHeader=False"
    Print #intFile, "Col1=""Field1"" Text"
    Print #intFile, "Col2=""Field2"" Text"
    Print #intFile, "Col3=""Field3"" Text"
    Print #intFile, "Col4=""Field4"" Text"
    Print #intFile, "Col5=""Field5"" Text"
    Print #intFile, "Col6=""Field6"" Text"
    Print #intFile, "Col7=""Field7"" Text"

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    I don't know if you can do it that way. See Much ADO About Text Files.

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='800235' date='28-Oct-2009 10:37']I don't know if you can do it that way. See Much ADO About Text Files.[/quote]

    RESOLVED!


    but...

    in column 7 of csv have a date in this format :2009/06/07 (yyyy/mm/dd) is possible to format the column 7 in schema ini in dd/mm/yyyy?
    Note:
    to the default i have formated all column i n text, only for experiment..

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    You can specify the date format to be read from the text file by including a line in the schema.ini file

    DateTimeFormat=yyyy/mm/dd

    (This line should be after the file name and before the column specifications)

    Specify Date as the data type for the date column(s).

    The date field(s) will be displayed using your system date format.

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    [H_-_Report_dei_Prodotti_per_Agenzia.csv]
    MaxScanRows=1
    Format=Delimited(;)
    DateTimeFormat=yyyy/mm/dd
    ColNameHeader=TRUE
    Col1="DTR" Text
    ...

Posting Permissions

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