24. juli 2001 - 17:16Der er
7 kommentarer og 1 løsning
den skal kunne eksporter åøe ... dosformat.
hej ! jeg har en kode der laver en csv-fil på baggrund af en forspg. spec. men yderliger tilføjer den en start og slut record på baggrund nogle felter i en form.... men mit problem er at de felter ikke bliver formateret. kan man formater det vha. VBA så den bruger de rigtige dos formater istedet ......
Am i correct in saying that the start and slut records NOT written to the CSV file by your forspg. spec, and by soem other method? If thats correct then what (how) do you do this?
Dim lgde As Integer Dim txt As String Dim felt1, felt2, felt3, felt4, header, sti As String felt1 = Me.felt1 & \";\" felt2 = Format(Me.felt2 & \";\") felt3 = \"F\" + Chr(132) + \"rg och lack Scandinavia\" felt4 = Me.felt4 & \";\" header = felt1 + felt2 + felt3 sti = Me.sti If sti = \"C:\\\" Then GoTo S1
If sti = \"D:\\\" Then GoTo S1 sti = sti & \"\\\" S1: DoCmd.TransferText acExportDelim, \"FspPUV Eksportspecifikation\", \"fspPUV\", \"c:\\temp01.csv\", False, , codepage820
Open sti & \"Nybladfil.csv\" For Output As #1 Print #1, [header] + Chr$(13) + Chr$(10) Open \"c:\\temp01.csv\" For Input As #2 lgde = 0 While Not EOF(2) Line Input #2, txt Print #1, txt + Chr$(13) + Chr$(10) lgde = lgde + 1 Wend txt = [felt4] txt = txt + Format(lgde) Print #1, txt Close #1 Close #2 Kill \"C:\\temp01.csv\"
Is it the Chr(132) your having problems with and what ever you enter in felt4?
I cant test your code as I dont have your spec.
If I understand your code correctly you create a a csv file temp01.csv and then read it again and writing out to a file first writing the header and then the trailer(last record).
I would think it would be necessary to check each character of the header and trailer and convert ÅåÆæØø to the correct ASCII value (codepage820) before writing them to the file.
Hi juks>Looks like it scleaning up time :o) Most of these questions are forgoten a long time ago :o))
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.