🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: be.comp.programming
Article #7024

Re: VBA: LOF maximum lengte 2048 ?

#7024
From: barvok
Date: Fri, 25 Oct 2002 18:21
48 lines
2313 bytes
In article <bmYt9.177078$8o4.28363@afrodite.telenet-ops.be>, 
bartvanwijnsberghe@DELETE!!SPAMyahoo.com says...
> Ik zou moeten een file inlezen in een tekstbox in Access XP. Ik heb daarvoor
> volgende code:
> 
> Private Sub Form_Load()
>     Dim file As String
>     file = "D:\Mijn documenten\testAccess\test.html"
>     Open file For Input As #1
>     FileLength = LOF(1)
>     Debug.Print FileLength
>     mailtekst.SetFocus
>     mailtekst.Text = Input(LOF(1), #1)
>     Close
> End Sub
> 
> LOF mag blijkbaar maar 2048 zijn.  Als er meer dan 2048 tekens zijn in mijn
> bestand krijg ik de fout: "Fout 2176 tijdens uitvoering: De instelling voor
> deze eigenschap is te lang".
> 
> Is er een andere mogelijkheid om een grotere file in te lezen ?
> 
> mvg
> Bart
> 
> 
je zou dit kunnen doen met het FileSystemObject
Leg een reference naar Microsoft Scripting Runtime (scrrun.dll)
dan...
Function GetFile as string
	dim fs as new filesystemobject
	dim ts as textstream
	dim strTekst as string

	set ts=fs.opentextfile("mijnfile.txt")
	do until ts.atendofstream
		strtekst = ts.readline			
	loop

	getfile = strtekst	
	ts.close
	set ts=nothing
	set fs=nothing
end Sub

Probeer dit eens?

mvg, K.
Technical Details
Message-ID: <MPG.1823aa2fd18c2eea98968c@news.pandora.be>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-04!supernews.com!easynet-quince!easynet.net!proxad.net!proxad.net!skynet.be!skynet.be!ossa.telenet-ops.be!afrodite.telenet-ops.be.POSTED!not-for-mail
References: <bmYt9.177078$8o4.28363@afrodite.telenet-ops.be>

Show Full Headers
Complete Article Headers
X-Google-Language: DUTCH,ASCII-7-bit
X-Google-Thread: 107324,dc7e0de2aed95b63
X-Google-Attributes: gid107324,public
X-Google-Thread: fcea4,dc7e0de2aed95b63
X-Google-Attributes: gidfcea4,public
X-Google-ArrivalTime: 2002-10-25 13:10:08 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-04!supernews.com!easynet-quince!easynet.net!proxad.net!proxad.net!skynet.be!skynet.be!ossa.telenet-ops.be!afrodite.telenet-ops.be.POSTED!not-for-mail
From: barvok <pvbuiten@hotmail.com>
Newsgroups: be.comp.programming,nl.comp.programmeren
Subject: Re: VBA: LOF maximum lengte 2048 ?
Message-ID: <MPG.1823aa2fd18c2eea98968c@news.pandora.be>
References: <bmYt9.177078$8o4.28363@afrodite.telenet-ops.be>
Organization: news.pandora.be
X-Newsreader: MicroPlanet Gravity v2.60
Lines: 48
Date: Fri, 25 Oct 2002 18:21:58 GMT
NNTP-Posting-Host: 213.119.133.193
X-Complaints-To: abuse@telenet.be
X-Trace: afrodite.telenet-ops.be 1035570118 213.119.133.193 (Fri, 25 Oct 2002 20:21:58 MET DST)
NNTP-Posting-Date: Fri, 25 Oct 2002 20:21:58 MET DST