# filelen in VB6



## ansari1340 (Jun 12, 2005)

Dears:
I have a problem in VB6 programming described as follows:
1-When I use the "filelen" command and the file size is over 2GB 
compiler reply a minus number that is not correct .
2- When I use the "sqldmo.dll" in client can not backup from database 
of sql server, but if sql be on client I can use backup .

Please advise me ,and thanks in advance for your cooperation .

Rgds.
Masoud Ansari


----------



## Aftab (Oct 15, 2003)

FileLen() returns a long integer which has a limit of 2Gb. Declare a double variable and use the size property of the file object (filesystemobject).

Dim fs As New FileSystemObject
Dim fi As File
Dim s As Double

Set fi = fs.GetFile("c:\autoexec.bat")
s = fi.Size


----------

