Invalid Procedure Call or Arguments

Hi,
I got this error ("Invalid Procedure Call or Arguments") when run this
code:

'Delete drawing files
Set fs = CreateObject("Scripting.FileSystemObject")
Set fld = fs.GetFolder(pubWorkingDir & "Drawings\")
Set rsc = dbs.OpenRecordset("SELECT * FROM tblDrawings WHERE ID=" &
tempItemID, dbOpenDynaset)
rsc.MoveFirst
Do While Not rsc.EOF
      If Dir(pubWorkingDir & "Drawings\" & rsc!DrawingFile) <> "" Then
           fld.Files(pubWorkingDir & "Drawings\" & rsc!
DrawingFile).Delete True    '(the error caused by this line)
      End If
      rsc.MoveNext
Loop
rsc.Close
Set rsc = Nothing
Set fld = Nothing
Set fs = Nothing

and the programm stop at this line " fld.Files(pubWorkingDir &
"Drawings\" & rsc!DrawingFile).Delete True    " and the error come
out .
Do I miss somthing?
Thanks for any help
Yanto
-1
yanto
12/3/2007 9:09:10 AM
access.formscoding 7493 articles. 0 followers. Follow

2 Replies
1735 Views

Similar Articles

[PageSpeed] 52

"yanto" <yanto2000@gmail.com> wrote in message 
news:ab6562be-1700-446f-90c1-43abc0b655b2@e25g2000prg.googlegroups.com...
> Hi,
> I got this error ("Invalid Procedure Call or Arguments") when run this
> code:
>
> 'Delete drawing files
> Set fs = CreateObject("Scripting.FileSystemObject")
> Set fld = fs.GetFolder(pubWorkingDir & "Drawings\")
> Set rsc = dbs.OpenRecordset("SELECT * FROM tblDrawings WHERE ID=" &
> tempItemID, dbOpenDynaset)
> rsc.MoveFirst
> Do While Not rsc.EOF
>      If Dir(pubWorkingDir & "Drawings\" & rsc!DrawingFile) <> "" Then
>           fld.Files(pubWorkingDir & "Drawings\" & rsc!
> DrawingFile).Delete True    '(the error caused by this line)
>      End If
>      rsc.MoveNext
> Loop
> rsc.Close
> Set rsc = Nothing
> Set fld = Nothing
> Set fs = Nothing
>
> and the programm stop at this line " fld.Files(pubWorkingDir &
> "Drawings\" & rsc!DrawingFile).Delete True    " and the error come
> out .
> Do I miss somthing?
> Thanks for any help
> Yanto

You don't need to use the FSO for this. The built-in VBA command Kill will 
do the job nicely:

Set rsc = dbs.OpenRecordset("SELECT * FROM tblDrawings WHERE ID=" & 
tempItemID, dbOpenDynaset)
rsc.MoveFirst
Do While Not rsc.EOF
    If Dir(pubWorkingDir & "Drawings\" & rsc!DrawingFile) <> "" Then
        Kill pubWorkingDir & "Drawings\" & rsc!DrawingFile
    End If
    rsc.MoveNext
Loop


0
Stuart
12/3/2007 9:36:16 AM
On Dec 3, 1:36 am, "Stuart McCall" <smcc...@myunrealbox.com> wrote:
> "yanto" <yanto2...@gmail.com> wrote in message
>
> news:ab6562be-1700-446f-90c1-43abc0b655b2@e25g2000prg.googlegroups.com...
>
>
>
>
>
> > Hi,
> > I got this error ("Invalid Procedure Call or Arguments") when run this
> > code:
>
> > 'Delete drawing files
> > Set fs = CreateObject("Scripting.FileSystemObject")
> > Set fld = fs.GetFolder(pubWorkingDir & "Drawings\")
> > Set rsc = dbs.OpenRecordset("SELECT * FROM tblDrawings WHERE ID=" &
> > tempItemID, dbOpenDynaset)
> > rsc.MoveFirst
> > Do While Not rsc.EOF
> >      If Dir(pubWorkingDir & "Drawings\" & rsc!DrawingFile) <> "" Then
> >           fld.Files(pubWorkingDir & "Drawings\" & rsc!
> > DrawingFile).Delete True    '(the error caused by this line)
> >      End If
> >      rsc.MoveNext
> > Loop
> > rsc.Close
> > Set rsc = Nothing
> > Set fld = Nothing
> > Set fs = Nothing
>
> > and the programm stop at this line " fld.Files(pubWorkingDir &
> > "Drawings\" & rsc!DrawingFile).Delete True    " and the error come
> > out .
> > Do I miss somthing?
> > Thanks for any help
> >Yanto
>
> You don't need to use the FSO for this. The built-in VBA command Kill will
> do the job nicely:
>
> Set rsc = dbs.OpenRecordset("SELECT * FROM tblDrawings WHERE ID=" &
> tempItemID, dbOpenDynaset)
> rsc.MoveFirst
> Do While Not rsc.EOF
>     If Dir(pubWorkingDir & "Drawings\" & rsc!DrawingFile) <> "" Then
>         Kill pubWorkingDir & "Drawings\" & rsc!DrawingFile
>     End If
>     rsc.MoveNext
> Loop- Hide quoted text -
>
> - Show quoted text -

Thanks Stuart, it's worked.
Best Regards
Yanto
0
yanto
12/4/2007 3:38:05 AM
Reply:

Similar Artilces:

SDK API calls from a web service
If I have a web service that performs operations on CRM objects using the Microsoft.Crm.Platform.Proxy.* classes, how do I switch the context of the web service to be an authenticated CRM user? This is not very clear from the CRM SDK doc. e.g. I want to Create() a new Account, Contact or Lead. Barry Mavin Recital Corporation I Have figured this out for myself. Thanks anyway. Barry Mavin Recital Corporation >-----Original Message----- >If I have a web service that performs operations on CRM >objects using the Microsoft.Crm.Platform.Proxy.* classes, >how do I switch th...

BAK file include stored procedure
Can stored procedures be included in a backup file, .bak? I'm thinking only the data is in the bak file, but is there some way I can include the stored procedures? Thanks for your help. "SAC" <sac@somewhere.com> wrote in message news:%233IirnfGLHA.4120@TK2MSFTNGP02.phx.gbl... > Can stored procedures be included in a backup file, .bak? I'm thinking > only the data is in the bak file, but is there some way I can include the > stored procedures? A backup file created using the backup command contains everything in the database - includin...

Cannot void credit card transactions
For some reason we can't void transactions. When I try to do the void, it will first give the error message: "an invalid card number was detected." If I try to re-enter the card information correctly (swipe or hand-key) it starts to process the void, but never finishes. The status bars indicate that something is happening, but I don't believe them. It will take about 10 min to reach the end of the status bar box (the blue squares) and then it will stop and do nothing and the only way to close it is by shutting down the whole program-- ctrl+alt+del. We can, however, recall tr...

Invalid page fault and Stack Fault in Kernel32.dll
Hi, My exe comes out with two types of errors like : 1.PG1609VV caused an invalid page fault in module KERNEL32.DLL at 017f:bff9dfff. Registers: EAX=07fbfe38 CS=017f EIP=bff9dfff EFLGS=00000206 EBX=81d10cbc SS=0187 ESP=07fbfc88 EBP=07fbfe38 ECX=00000187 DS=0187 ESI=81d10cbc FS=130f EDX=07fbfe28 ES=0187 EDI=10a00200 GS=0000 Bytes at CS:EIP: cc a1 e0 9c fc bf 8b 00 66 64 f7 05 1c 00 00 00 Stack dump: 5f400000 81d10d00 81cfa0c4 81cfee84 00000652 c1ad4eb0 00000000 00000000 00000000 bff713ee 0000017f 82564aec bff7a3bc 00082565 ffffffff 00000000 2.PG1609VV caused a stack fault in module ...

Consecutive ma-open calls are failing with error 3051
Hello. I'm having a problem with exchange 5.5sp3 on windows NT 4.0sp6 TSE (I know, pretty old environment. The upgrade is in my todo list). I will try to explain the issue. Sometimes I get this message because space left on disk is less than 10MB: "The MTA is terminating because the disk where MTADATA is located has less than 10MB of space, or an error occurred while trying to check for free space on the disk. If disk space is low, free up some disk space and restart the MTA. NT Error code returned: 0 (non-zero indicates an error while checking for free space) [BASE IL TIMER 3] (16)&...

EASY: Awkward singleton calls
Hi everyone, I'm learning about singletons. This is probably an easy question. In my project design, I hope to create several small singletons that have global scope and for which I never have to create an object instance. I just say "using MySingletonNamespace" and thereafter have full access to the singleton and all the members. So far, that's working. The problem is at calling time. I wish I could call the methods in my singletons with this way: MySingleton.MyMethod (param1, param2) But I am finding that I cannot avoid going through the Instance ...

How to refresh an IFrame in phone call activity form
I friends, I have added one Iframe in Phonecall Activity form. now i need to refresh that particular Iframe for every 2 seconds. ( the URL of the Iframe is my own Web page, if i run my web page out side the CRM appl. its getting refresh for every 2 seconds, but the changes is not reflecting in CRM Phonecall Activity. To get the changes in CRM phone call Activity form i have to refresh total Phonecall Activty form. so, that i need to refresh that particular Iframe.). And my second need is : i want to get a value of particular field in CRM Phonecall Activity and then i have to pass th...

Error: The subscription to publication is invalid in SFO offline whenever i disable and re-enable replication
Hi, I'm getting the Error: "The subscription to publication is invalid" in the SFO when I try to go offline whenever i disable and re-enable replication. I only know how to fix it by re-installing SFO. There must be another solution as I imaginine my customers may want to sometimes disable replication. In which case, all of their clients shouldn't need to re-install the SFO client. Is this by design? Or is there something in the replication settings which i could do? Thanks Linna ...

Problem installing Business Portal 3.0: "invalid site owner" error
Hi there. I've got extremely little Great Plains knowledge, and I've been tasked with installing Business Portal (I do some SharePoint admin for my company). I'm trying to practice the install on my SharePoint test server, which was already running SharePoint Portal Server/Windows SharePoint Services and has a bunch of SP demo sites running. Near the beginning of the Business Portal installation, at the window where it asks you to specify the Business Portal SQL Login ID, I left it as the default of BusinessPortalServer, because the description states that if you leave it as...

How to call Web Service Securely
I love Web Apps in ASP.NET 2.0 because you can easily deny users access to pages by role or user. But for desktop client to webservice methods, I am not sure what to do.... I am looking for the simplest and safest method or pattern to have my Desktop client be able to call a web services securely. Assume my webservice proxy has 15 methods. By securely, I want the Client desktop app to pass some kind of simple username/password token -- something - but not in plain text - so that acces to the web call either immediately succeeds or fails. I don't know where to start - what is...

whether web service method's argument must be string?
I have used SOAP UI to check my web service. It supports POST, XML and SOAP content types. The web service method takes three arguments of the three, the first one is of type char. The SOAP UI returns a serialization error, and after I convert char into string it is working fine. Is this a limitation of web service method or problem with SOAP UI? How do I write a client application in C# to consume the web service using different content types, such as POST, XML and SOAP? Note: My web service need to support all these three. Thank you Regards Raj ...

call JavaScript function from asp
I am using Access database, ASP, and some Javascript. A Group of two radio buttons. Button "noshow" updates a record and calls a javascript function. The javascript function puts a value in a hiddenfield. Button "show" updates the same record and places a different value in the same hiddenfield without using the javascript function. <label> <input name="RadioGroupA" type="radio" id="noshow" value="&lt;!--" <% If Recordset2("image_code_A")="<!--" Then %> check...

Test before making remote WMI calls
What is the best way to test to see if a machine is accessible/online before making remote WMI calls to it? Thank you so much in advance. Regards, Nick "Nick" <sprynick@gmail.com> wrote in message news:8f513bc7-341b-4398-a83d-cbf9f01f619d@a6g2000yqm.googlegroups.com... > What is the best way to test to see if a machine is accessible/online > before making remote WMI calls to it? Thank you so much in advance. > > Regards, > Nick The best method I know of is to ping the computer. Especially if you can control the timeout, this is much faster th...

could i customize the dialog that popups up when calling SHBrowserForFolder
i wanna add a checkbox to the dialog, could i?how? thanks in advance I guess there is no way to customize the common dialog, you must create a new dialog and provide the required functionality in it /Kiran thinktwice wrote: > i wanna add a checkbox to the dialog, could i?how? > thanks in advance Take a look at this article. I'm not sure this is what you want, but it's cheap to look. http://www.codeproject.com/dialog/yabffwcp.asp Tom "thinktwice" <memorialday@gmail.com> wrote in message news:1158055405.669054.272220@d34g2000cwd.googlegroups.com... >i...

Call Function from aspx
I am really having trouble with this. I am trying to call a function from my .vb file within my .aspx file. My current results is that nothing happens. Wondering if someone can help me out. <form id="form1" runat="server"> <div> <br /> <asp:Label ID="Label1" runat="server" Text="<%= helloworld() %>"></asp:Label> <br /> </div> </form> and from my .vb file: Partial Class _Default Inherits System.Web.UI.Page Function hellowo...

Is there any function which gets called when the dialog receives the focus??
Hi all, I want a function which gets called when ever the dialog receives the focus. Is there any function like that available or else how can I call a user defined function which gets called when the dialog receives the focus. Thanks in Advance Use OnActivate(...) handler for the dialog. -- Vipin Aravind "aarya" <kk.simhadri@gmail.com> wrote in message news:1138084577.419720.26300@g14g2000cwa.googlegroups.com... > Hi all, > I want a function which gets called when ever the dialog > receives the focus. > Is there any function like that availabl...

CDialog + 0xC0000008: Invalid Handle
Hello, I'm getting a somewhat bizarre error with a CDialog inherited class. I've commented the code as much as possible to make it easier for you to follow the execution of the code. Quick note: "<-- break point set here means" that I've set a break point at that point for the debugger to break the execution. dev system specs: winxp + sp1 msvc6 + sp5 //-------------------------------------- // Step 1: Create from heap and display it //-------------------------------------- MyDlg dlg; <-- break point set here : see step 2 dlg.DoModal(); <-- break point s...

Error 94 Invalid Use of Null
This code was working at first with the help of the experts on this site but I went on a 2 week Military Training and came back to finish up this database and now it's giving me an error of "Error 94 Invalid Use of Null". What in creation could have happened? This is my code. Could it be the formatting on the form? I think I changed the formatting of cells and am not using some of the fields. Please HELP!! Private Sub AddAppt_Click() On Error GoTo AddAppt_Err ' Save record first to be sure required fields are filled. DoCmd.RunCommand acCm...

ODBC --call failed
Hello all I change the ODBC (because we move to a new server) and now I am getting a "ODBC--call failed" error in some of my queries. What is the first thing I need to look at? everything should work just find since the name of tha tables are the same, data are the same everything is the same, it just a different ODBC name. The problem is ocurring in an append query, this is the error I am getting: ODBC--call failed. [Informix][Informix ODBC Driver][Informix]A syntax error has occurred. (#-201) What is weird is that I have a lot of other queries and they all work perfect. But I am...

Converting View to Stored Procedure
Hello, I know there have been long conversations with a lot of details describing benefits and drawbacks of using a stored procedure over a view... and vice versa. I'm re-writing some query objects to improve performance and there is one view I've come across that is particularly difficult for me to make a decision on how best to handle. The view itself is probably hit 40K+ times a day from an online application, and in mild terms, it's a bit of a beast. The view itself contains about 10 different joins and has some nasty case statements and complex use of functions (user...

expression has invalid reference to property form/report
Can any one help...I modified my form and tested n work perfectly well when I copied and past the table and form just the structure to the real time...it keep giving me run time error 2455 and the message " Expression that has an invalid reference to the property form/report" Can any one help..many thanks Galrabb Galrabb - You need to post your code for us to help... Any information on the object that is erroring out will help... -- Daryl S "expression has invalid reference to prop" wrote: > Can any one help...I modified my form and teste...

How to use a variable as an argument in .FliiDown
As part of a Sub, I have the following code that I want to use to fill down worksheet formulas. I’ve defined integer variables for totalRows, lastRow and lastFilledRow in a defined range, ”StocksFormlas.” The defined range is (“F8:O40”). I’ve also defined a “y” variable as Range. At last run, the returned values for the integer variables are TotalRows = 33 lastFilledtRow = 14 The first line of code snippet (1), below selects “F14”. The second line does the fillDown correctly, but only if I specify the fillDown arguments in “A1” form. I’ve tried everything I know to accompli...

scheduling phone calls
Is there any way to make a list of phone calls to be made the next day or at a certain time in the future? Outlook Express has a particular section on the calendar page for this but I can't find a way to do it in Outlook. Click into the contact that you want to call or the person you want to schedule a meeting with and then click Actions - you have lots of options from there. You can set reminders - recurring reminders etc. >-----Original Message----- >Is there any way to make a list of phone calls to be made >the next day or at a certain time in the future? Outlook &...

call a mapbasic program
Is it possible to call a mapbasic program using VBA (access) thanks hi, On 23.02.2010 10:40, Al wrote: > Is it possible to call a mapbasic program using VBA (access) Shouldn't you ask the guys from MapInfo how to do that? mfG --> stefan <-- Yes you can call MapInfo from VBA Access. Download the mapbasic its free in that you will find different ways. I am showing one of the way I used. Dim mi As Object Sub Form_Load() Set mi = CreateObject("MapInfo.application") mi.do "Set Application Window " & Form1.hWnd mi.do "Set Next Do...

VBA and calling stored procedures
Hi, I am wanting to call a stored procedure from VBA code. I am wanting to automatically update the release fields one the POP10100 and POP10110 when the user marked a blanket PO line's as released and saved (without 1st printing) - normally one needs to pribnt first before these statusses change. At the same time the Qty on order fopr the releted item needs to be updated. Below I attach the code I am trying to use with scripting. However I'd prefer to call Dynamics stored procedures that will either 1)effectively does the 'Print PO' functiionlity without the actual pr...