473,405 Members | 2,176 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Vb6 Object required error

104 100+
Hi, please could you tell me where i have gone wrong to get this error.

VB6 code


Dim fso As New FileSystemObject
Dim f As file
Set f = fso.getFile(App.Path & "\" & "\data\adodb1.mdb")
FileSystemObject.CopyFile App.Path & "\" & "\data\adodb1.mdb", App.Path & "\" & "\data\adodb2.mdb"

Thank you
Feb 10 '08 #1
8 6257
mafaisal
142 100+
Hello
Here
Set f = fso.getFile(App.Path & "\" & "\data\adodb1.mdb") change
to
Set f = fso.getFile(App.Path & "\data\adodb1.mdb")

ie i think one "\" is excess try
also
next line avoide excess "\"

Faisal

Hi, please could you tell me where i have gone wrong to get this error.

VB6 code


Dim fso As New FileSystemObject
Dim f As file
Set f = fso.getFile(App.Path & "\" & "\data\adodb1.mdb")
FileSystemObject.CopyFile App.Path & "\" & "\data\adodb1.mdb", App.Path & "\" & "\data\adodb2.mdb"

Thank you
Feb 10 '08 #2
Wernerh
104 100+
Hello
Here
Set f = fso.getFile(App.Path & "\" & "\data\adodb1.mdb") change
to
Set f = fso.getFile(App.Path & "\data\adodb1.mdb")

ie i think one "\" is excess try
also
next line avoide excess "\"

Faisal
Hi Faisal,

I have done the changes and still have the same "error 424 Object required" :-<<

Please check again for me.

Thanks
Werner
Feb 10 '08 #3
Wernerh
104 100+
Hi Faisal,

I have done the changes and still have the same "error 424 Object required" :-<<

Please check again for me.

Thanks
Werner
Herewith the changed code;

Dim fso As New FileSystemObject
Dim F As File
Set F = fso.GetFile(App.Path & "\data\adodb1.mdb")
FileSystemObject.CopyFile App.Path & "\data\adodb1.mdb", App.Path & "\data\adodb2.mdb"

Thanks
Werner
Feb 10 '08 #4
Wernerh
104 100+
Do I have to declare anything else other than the code posted for this to work?
Feb 10 '08 #5
mafaisal
142 100+
Hello

Try This

Dim F1,F2 as string
Dim FSO As New FileSystemObject
F1 = App.Path & "\data\adodb1.mdb"
F2 = App.Path & "\data\adodb2.mdb"
FSO.CopyFile F1,F2,True

Use Object of Filesystemobject
Faisal
Feb 10 '08 #6
Wernerh
104 100+
Hello

Try This

Dim F1,F2 as string
Dim FSO As New FileSystemObject
F1 = App.Path & "\data\adodb1.mdb"
F2 = App.Path & "\data\adodb2.mdb"
FSO.CopyFile F1,F2,True

Use Object of Filesystemobject
Faisal
Thanks Faisal, you are a star. It works perfectly now.

Cheers
Werner
Feb 11 '08 #7
Ali Rizwan
925 512MB
For copying process you can do a simple code instead of doing all this.

CopyFile(Path,Path)

if you got error then try FileCopy. I have doubt between Copyfile and filecopy.

This will create a duplicate of original file where you want.

Regards
>> ALI <<
Feb 11 '08 #8
mafaisal
142 100+
Hello,
Always Wlecome
Thanx


Thanks Faisal, you are a star. It works perfectly now.

Cheers
Werner
Feb 11 '08 #9

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

Similar topics

2
by: Dave Hammond | last post by:
I've got what should be a simple assignment of either an element value or a default string to a variable, but when the element doesn't exist I get an "Object required" error rather than an...
0
by: muralidharan | last post by:
WebForm1.aspx Code: <%@ Register TagPrefix="ComponentArt" Namespace="ComponentArt.Web.UI" Assembly="ComponentArt.Web.UI" %> <ComponentArt:TreeView id="TreeView1" Height="520"...
9
by: Remulac | last post by:
Hello, I'm trying to get the value out of a dropdown list box and assign it to a variable. When I click on the list box, I invoke this line of code. I get the error, "Object reference not set...
3
by: Adriano | last post by:
Hello, when I try to print something, either DataGrid or from Crystal Report viever the folowing error message appears and cancels printing: Object reference not set to an instance of an...
0
by: Deepak C.G via .NET 247 | last post by:
I want to dispose the image object in my child form, unless I won't dispose this object i can't delete the image file in my folder. I get this error in MDIparent form "An unhandled exception...
8
by: ST | last post by:
Hello everyone, Can anyone help me with this error above when I debug my web app project in vstudio.net?? I can't figure it out! It was working fine for months, and now all of a sudden it's not!!...
1
by: Don | last post by:
I'm getting the following exception displayed in the task list at design time for my project: "Code generation for property 'Controls' failed. Error was: 'Object reference not set to an...
4
by: ink | last post by:
Hi All I am relatively new to doing this and i think that i am making some king of school boy error. The error i am getting is on the following line of code. XmlSerializer xs = new...
4
by: livmacca | last post by:
Hi, I am new to VB .Net programming and is trying to create a webpage. I encountered the following error and is totally clueless on how to make it work: ...
14
by: chromis | last post by:
Hi, I've been trying to implement a more OOP oriented approach to dealing with user security on one of my websites, and I am trying to validate the user against an array of roles, however I am...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...

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.