473,473 Members | 2,021 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Check whether file exist in computer, ask for help!

48 New Member
Dear friends,

I need to use VB6 to check whether the file is existing in my computer. How can I do it?

I had search this similar topic in this forum. Although I found one, thats not working at all. Perhaps, there is still other ways.

Best Regards.
Mar 25 '07 #1
4 1800
Dököll
2,364 Recognized Expert Top Contributor
Greetings, Kuzure!

Here is what I found through Dev Fusion:

http://www.developerfusion.co.uk/show/4264/

Hopefully this what you are looking for. Give it a whirl.

Dököll
Mar 25 '07 #2
SammyB
807 Recognized Expert Contributor
Dear friends,

I need to use VB6 to check whether the file is existing in my computer. How can I do it?

I had search this similar topic in this forum. Although I found one, thats not working at all. Perhaps, there is still other ways.

Best Regards.
In VB6 and VBA you use the Dir function. If you type Dir in your code & press F1, the help file will tell you how to use it. Here's a simple example.
Expand|Select|Wrap|Line Numbers
  1.     Dim sFileSpec As String
  2.     sFileSpec = "C:\Documents and Settings\Sam\My Documents\Test.txt"
  3.     If Dir(sFileSpec) = "" Then
  4.         MsgBox "Test.txt does not exist"
  5.     End If
Mar 25 '07 #3
Killer42
8,435 Recognized Expert Expert
In VB6 and VBA you use the Dir function. ...
Plus, if the other solution you tried, which didn't work, was using the FileSystemObject, then to make it work you probably need to add “Microsoft Scripting Runtime” in References, under your Project menu.
Mar 25 '07 #4
kuzure
48 New Member
In VB6 and VBA you use the Dir function. If you type Dir in your code & press F1, the help file will tell you how to use it. Here's a simple example.
Expand|Select|Wrap|Line Numbers
  1.     Dim sFileSpec As String
  2.     sFileSpec = "C:\Documents and Settings\Sam\My Documents\Test.txt"
  3.     If Dir(sFileSpec) = "" Then
  4.         MsgBox "Test.txt does not exist"
  5.     End If

Thanks, sammyb.

Best Regards.
Mar 26 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Chin Chien Ping | last post by:
Hi, I looking for a solution for how to check if a connection to a remote computer exist or not using vb.net. I 'm writing a program which will request data from a remote sql server. I need...
2
by: adam | last post by:
hello What query shoul I send to SQL serwer ( in transact SQL language ) to check does some database exist on serwer ? It similar to problem "does some table exist in database" - resolve to it...
10
by: Raymond | last post by:
Hi All: To find a file exists using the file name, I have tow routings on UNIX system. 1. access(2) 2. lstat(2) This tow function also can do. When the return value is "-1" and errno is...
7
by: andylcx | last post by:
Hi all: The c++ language can check whether the file exist or not. I am wondering how c language does this job? Thanks a lot! Andy
6
by: ItsMe | last post by:
Hi, I want to check whether the record exist or not based on my query, so i'll be using OleDbCommand. What is the best way to check on a huge table ? I used to write like this in VB6.0... ...
6
by: sree | last post by:
Hi, i want to check whether a file from remote server is existed or not. The file_exists() checks for local server only. But i want a function that checks the remote server.
1
by: eSolTec, Inc. 501(c)(3) | last post by:
Thank you in advance for any and all assistance. It is greatly appreciated. Is there a way to programmatically check for .NET Framework versions installed on the computer? -- Michael Bragg,...
6
by: Ros | last post by:
There are 10 files in the folder. I wish to process all the files one by one. But if the files are open or some processing is going on them then I do not want to disturb that process. In that case...
2
by: joemo2003 | last post by:
How to use VBA to check does a reference library exist? In my case, some computer have visio installed, but some don't. So i want use VBA to check does that visio reference exist on that computer. ...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.