Results 1 to 9 of 9
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I use this schema.ini for a access table in Access.

    Is possible to create the line column (in bold) dinamiclly based a reading in filed property and name?

    Code:
    Dim intFile, lngImported As Long, ULTIMA As Long
        
        On Error GoTo errore
        
        ULTIMA = Empty
        Close #intFile
        
        intFile = FreeFile(0)
        
        Open SPATH & "\schema.ini" For Output As #intFile
        
        Print #intFile, "[" & NOME_FILE & "]"
        Print #intFile, "MaxScanRows=1"
        Print #intFile, "Format=Delimited(;)"
        Print #intFile, "ColNameHeader=TRUE"
               
        Print #intFile, "Col1=""DATA_RIF""Text"
        Print #intFile, "Col2=""AGENZIA_CENTRO""Text"
        Print #intFile, "Col3=""SEGM""Text"
        Print #intFile, "Col4=""C_OPER""Text"
        Print #intFile, "Col5=""MS""Text"
        Print #intFile, "Col6=""MERC""Text"
        Print #intFile, "Col7=""TOT_OPE""double"
        Print #intFile, "Col8=""TOT_PEZ""double"
        Print #intFile, "Col9=""TOT_IMPORTO""double"    
        Close #intFile

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yes perefect! (you have understand me on fly) kiss for that.
    But how to call the function and wath is the param to call the function?
    And i can use this function in a vba for Excel macro?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Please see the explanation in the MSKB article and the example below the code.

  5. #5
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by HansV View Post
    Please see the explanation in the MSKB article and the example below the code.
    pERFECT, TKS!
    all work fine...

    but is possible to insert a format in column when the code write the schema.ini?
    For example the:

    Print #intFile, Col2=AGENZIA_CENTRO Text format"#0000"

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    You can't specify a format for individual columns in a Schema.ini file, as far as I know.

  7. #7
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by HansV View Post
    You can't specify a format for individual columns in a Schema.ini file, as far as I know.
    hummmm....
    Now admit have myvar=tttt;555;65tttt;...eccc
    how to have the same var string whit format #0000 on the second element of string
    new myvar=tttt;0555;65tttt . ...

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    You'll have to format the value 555 as 0555 when you add it to myvar.

  9. #9
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by HansV View Post
    You'll have to format the value 555 as 0555 when you add it to myvar.
    yes.... I use this myvar to write in a txt file

Posting Permissions

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