• create schema.ini dinamic…

    Author
    Topic
    #464686

    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"
               
        [b]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"[/b]    
        Close #intFile
    
    Viewing 0 reply threads
    Author
    Replies
    • #1190532
      • #1190537

        See Creazione a livello di programmazione di un file schema.ini in Access 2000.

        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?

        • #1190539

          Please see the explanation in the MSKB article and the example below the code.

          • #1190574

            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″

            • #1190577

              You can’t specify a format for individual columns in a Schema.ini file, as far as I know.

            • #1190648

              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 . …

            • #1190650

              You’ll have to format the value 555 as 0555 when you add it to myvar.

            • #1190652

              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

    Viewing 0 reply threads
    Reply To: create schema.ini dinamic…

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: