Invalid procedure call or argument?

Hello All

This is a re-post of a problem I posted a while ago, but to which I got no 
suggestions: hopefully I'll be more lucky this time!?

I have the following code in a Private Sub:

If InStr([ResponseXML], "element") > 0 Then
errorfield = "Invalid " & Mid([ResponseXML], InStr([ResponseXML], 
"element"), InStr(InStr(InStr([ResponseXML], "element"), [ResponseXML], "'") 
+ 1, [ResponseXML], "'") - InStr([ResponseXML], "element") + 1)
Else
....

Most of the time this works fine, but for some datastring values of 
[ResponseXML] I get
Invalid procedure call or argument
and the code stops on the 'errorfield = ...' expression. This has occurred 
where [ResponseXML] does contain the string "element" (obviously - otherwise 
the code wouldn't get past the condition into the expression!). The curious 
thing is that if I use the exact same errorfield expression in a query, on 
the same value of [ResponseXML], it returns the expected result (which is 
<Invalid Element 'TaxCodeAtLeaving'> - without the <>s). I could understand 
it if I'd just got duff syntax, but the fact that the query works ...?

In case it helps, one value of [ResponseXML] where this problem occurs is 
below.

Hope someone can help
Many thanks
Leslie Isaacs


Problem value of [ResponseXML] follows:

....................HTTP Text: 200 OK
Request: submit_poll
Response: submit_error
CorrelationID: C3CFE512E3EB40D0B93A3A43A01348B1
Info: : The submission of this document has failed due to departmental 
specific business logic in the Body tag.
The submission of this document has failed due to departmental specific 
business logic in the Body tag.
<?xml version="1.0"?><GovTalkMessage 
xmlns="http://www.govtalk.gov.uk/CM/envelope"><EnvelopeVersion>1.0</EnvelopeVersion><Header><MessageDetails><Class>IR-PAYE-MOV</Class><Qualifier>error</Qualifier><Function>submit</Function><TransactionID></TransactionID><CorrelationID>C3CFE512E3EB40D0B93A3A43A01348B1</CorrelationID><ResponseEndPoint 
PollInterval="10">https://secure.gateway.gov.uk/poll</ResponseEndPoint><GatewayTimestamp>2009-11-12T15:55:39.662</GatewayTimestamp></MessageDetails><SenderDetails 
/></Header><GovTalkDetails><Keys 
/><GovTalkErrors><Error><RaisedBy>Department</RaisedBy><Number>3001</Number><Type>business</Type><Text>The 
submission of this document has failed due to departmental specific business 
logic in the Body tag.</Text></Error></GovTalkErrors></GovTalkDetails><Body>
<ErrorResponse xmlns="http://www.govtalk.gov.uk/CM/errorresponse" 
SchemaVersion="2.0">
<Application>
<MessageCount>2</MessageCount>
</Application>
<Error>
<RaisedBy>ChRIS</RaisedBy>
<Number>4085</Number>
<Type>schema</Type>
<Text>Value '0NT' doesn't have the correct format</Text>
<Location>/hd:GovTalkMessage[1]/hd:Body[1]/mov:IRenvelope[1]/mov:InYearMovements[1]/mov:P45Part1[1]/mov:TaxCodeAtLeaving[1]</Location>
<Application>
<Messages xmlns="http://www.govtalk.gov.uk/validation/messages/1">
<ServiceMessage>
<UserText number="7674">Tax code entered is not a valid code.</UserText>
</ServiceMessage>
<DeveloperMessage>cvc-pattern-valid: Value '0NT' is not facet-valid with 
respect to pattern 
'([1-9][0-9]{0,5}[LPTVY])|(BR)|(0T)|(NT)|(FT)|(D0)|([K][1-9][0-9]{0,5})' for 
type '_intermediate_TaxCodeStructure'.</DeveloperMessage>
</Messages>
</Application>
</Error>
<Error>
<RaisedBy>ChRIS</RaisedBy>
<Number>4052</Number>
<Type>schema</Type>
<Text>Element 'TaxCodeAtLeaving' must only have valid text as its 
content</Text>
<Location>/hd:GovTalkMessage[1]/hd:Body[1]/mov:IRenvelope[1]/mov:InYearMovements[1]/mov:P45Part1[1]/mov:TaxCodeAtLeaving[1]</Location>
<Application>
<Messages xmlns="http://www.govtalk.gov.uk/validation/messages/1">
<ServiceMessage>
<UserText number="7674">Tax code entered is not a valid code.</UserText>
</ServiceMessage>
<DeveloperMessage>cvc-complex-type.2.2: Element 'TaxCodeAtLeaving' must have 
no element [children], and the value must be valid.</DeveloperMessage>
</Messages>
</Application>
</Error>
</ErrorResponse>
</Body>
</GovTalkMessage>


0
Leslie
11/26/2009 10:29:14 AM
access.modulesdaovba 1670 articles. 0 followers. Follow

1 Replies
1758 Views

Similar Articles

[PageSpeed] 52

I would add the following code:

Dim MyStart As Integer
MyStart = InStr([ResponseXML], "element")

...and then use MyStart in place of all of the occurances of:
InStr([ResponseXML], "element")
...in the code. It will be easier to read and should expose the problem.

Leslie Isaacs wrote:
>Hello All
>
>This is a re-post of a problem I posted a while ago, but to which I got no 
>suggestions: hopefully I'll be more lucky this time!?
>
>I have the following code in a Private Sub:
>
>If InStr([ResponseXML], "element") > 0 Then
>errorfield = "Invalid " & Mid([ResponseXML], InStr([ResponseXML], 
>"element"), InStr(InStr(InStr([ResponseXML], "element"), [ResponseXML], "'") 
>+ 1, [ResponseXML], "'") - InStr([ResponseXML], "element") + 1)
>Else
>...
>
>Most of the time this works fine, but for some datastring values of 
>[ResponseXML] I get
>Invalid procedure call or argument
>and the code stops on the 'errorfield = ...' expression. This has occurred 
>where [ResponseXML] does contain the string "element" (obviously - otherwise 
>the code wouldn't get past the condition into the expression!). The curious 
>thing is that if I use the exact same errorfield expression in a query, on 
>the same value of [ResponseXML], it returns the expected result (which is 
><Invalid Element 'TaxCodeAtLeaving'> - without the <>s). I could understand 
>it if I'd just got duff syntax, but the fact that the query works ...?
>
>In case it helps, one value of [ResponseXML] where this problem occurs is 
>below.
>
>Hope someone can help
>Many thanks
>Leslie Isaacs
>
>Problem value of [ResponseXML] follows:
>
>...................HTTP Text: 200 OK
>Request: submit_poll
>Response: submit_error
>CorrelationID: C3CFE512E3EB40D0B93A3A43A01348B1
>Info: : The submission of this document has failed due to departmental 
>specific business logic in the Body tag.
>The submission of this document has failed due to departmental specific 
>business logic in the Body tag.
><?xml version="1.0"?><GovTalkMessage 
>xmlns="http://www.govtalk.gov.uk/CM/envelope"><EnvelopeVersion>1.0</EnvelopeVersion><Header><MessageDetails><Class>IR-PAYE-MOV</Class><Qualifier>error</Qualifier><Function>submit</Function><TransactionID></TransactionID><CorrelationID>C3CFE512E3EB40D0B93A3A43A01348B1</CorrelationID><ResponseEndPoint 
>PollInterval="10">https://secure.gateway.gov.uk/poll</ResponseEndPoint><GatewayTimestamp>2009-11-12T15:55:39.662</GatewayTimestamp></MessageDetails><SenderDetails 
>/></Header><GovTalkDetails><Keys 
>/><GovTalkErrors><Error><RaisedBy>Department</RaisedBy><Number>3001</Number><Type>business</Type><Text>The 
>submission of this document has failed due to departmental specific business 
>logic in the Body tag.</Text></Error></GovTalkErrors></GovTalkDetails><Body>
><ErrorResponse xmlns="http://www.govtalk.gov.uk/CM/errorresponse" 
>SchemaVersion="2.0">
><Application>
><MessageCount>2</MessageCount>
></Application>
><Error>
><RaisedBy>ChRIS</RaisedBy>
><Number>4085</Number>
><Type>schema</Type>
><Text>Value '0NT' doesn't have the correct format</Text>
><Location>/hd:GovTalkMessage[1]/hd:Body[1]/mov:IRenvelope[1]/mov:InYearMovements[1]/mov:P45Part1[1]/mov:TaxCodeAtLeaving[1]</Location>
><Application>
><Messages xmlns="http://www.govtalk.gov.uk/validation/messages/1">
><ServiceMessage>
><UserText number="7674">Tax code entered is not a valid code.</UserText>
></ServiceMessage>
><DeveloperMessage>cvc-pattern-valid: Value '0NT' is not facet-valid with 
>respect to pattern 
>'([1-9][0-9]{0,5}[LPTVY])|(BR)|(0T)|(NT)|(FT)|(D0)|([K][1-9][0-9]{0,5})' for 
>type '_intermediate_TaxCodeStructure'.</DeveloperMessage>
></Messages>
></Application>
></Error>
><Error>
><RaisedBy>ChRIS</RaisedBy>
><Number>4052</Number>
><Type>schema</Type>
><Text>Element 'TaxCodeAtLeaving' must only have valid text as its 
>content</Text>
><Location>/hd:GovTalkMessage[1]/hd:Body[1]/mov:IRenvelope[1]/mov:InYearMovements[1]/mov:P45Part1[1]/mov:TaxCodeAtLeaving[1]</Location>
><Application>
><Messages xmlns="http://www.govtalk.gov.uk/validation/messages/1">
><ServiceMessage>
><UserText number="7674">Tax code entered is not a valid code.</UserText>
></ServiceMessage>
><DeveloperMessage>cvc-complex-type.2.2: Element 'TaxCodeAtLeaving' must have 
>no element [children], and the value must be valid.</DeveloperMessage>
></Messages>
></Application>
></Error>
></ErrorResponse>
></Body>
></GovTalkMessage>

-- 
RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-modules/200911/1

0
ruralguy
11/26/2009 6:36:45 PM
Reply:

Similar Artilces:

Invalid syntax
I get the error invalid syntax for the following line : ( summing up figures in case GetBonus = Yes) Bonus : iif(getBonus = -1;nz(BonusL1;0)+ NZ([BonusL2];0)+ NZ([BonusL3];0) could you help ? -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-queries/200712/1 Ditch the semicolons. iif( Formula to test,results if true, results if false.) I would guess you want iif(getBonus = -1,nz(BonusL1;0)+ NZ([BonusL2];0)+ NZ([BonusL3],0) peljo via AccessMonster.com wrote: > I get the error invalid syntax for the following line : ( summing up figures...

Invalid File Format
When I start Excel I get an initial message that says ssipro97.dot is an invalid format. Any idea why this would come up? It doesn't seem to affect how Excel works, it's just annoyint. ...

Calling Procedure in Hidden Form
What is the syntax for calling an event procedure in a hidden form from a visible (current) form? My hidden form has two procedures: form_open and Closebutton_click. I assume when I open the hidden form the form_open procedure is run. I want to run the Closebutton_click procedure in the hidden form when a certain event occurs on the visible (current) form. The CloseButton_click will run some code and then close the hidden form. On Wed, 7 Apr 2010 06:26:06 -0700, Stu <Stu@discussions.microsoft.com> wrote: You can make that procedure Public rather than the current P...

How do I make a follow up call reminder from "Contacts"
I'd like to be able to open a contact, get the phone number, call the contact, leave a message, and then make an appointment with myself a week later to call the contact back to follow up with them. Basically, I'd like to be on a contact's page and make an appointment right from there. Then when the day for the follow up call comes along, I can click on it in my calendar and it will take me right to the contact page. Does this make sense? I'm sure it's a totally basic function. I have gotten as far as figuring out to drag the contact to "Calendar"...

problem with calling mfc dll from #C
Hi All, Debug Assertion Failed File dbgheap.c _CrtIsValidHeapPointer() I get the above while trying to CGAL::Intersection(Polygon_2 , Polygon_2,std::back_inserter(...)) in a MFC DLL project (Visual Studio .Net 2003) I call it from C# project. What to do to fix my project? Please Help Thanks Miki How are you calling the MFC dll? Is it managed code with MFC or simply an COM server which has been imported in managed code? Also, you are better off posting this in dotnet.vc newsgroup. -- Ajay Kalra [MVP - VC++] ajaykalra@yahoo.com "miki" <mich...

invalid handle
hi frds i m very new in vc++ and i m founding too much difficulty in this so plz can any one solve this problem .... actully i m inserting a image in list box using this code ........ everything is returning write thing still it is saying invalid handle after ImageList_Add(hList,m_hBmpNew,0); when i m going to dibug it plz help me BOOL Fun() { // Create 256 color image lists HIMAGELIST hList = ImageList_Create(32,32, ILC_COLOR8 , 8, 1); HBITMAP m_hBmpNew = (HBITMAP) LoadImage( AfxGetInstanceHandle(), // handle to instance "c:\\img.bmp", /...

OFX
When doing an update from my broker I get the message cannot establish secure communication with the server. Digital certificate is invalid. OFXIE12038. This is new happening in last month. Broker support says problem is Money 2002 not supported so I installed Money 2005 (with some qualms) and of course, still get the same message. I can access the brokerage website OK from Money, just cannot get statement downloads. -- Bill ...

Invalid Property Value
I have a macro that uses an input form to populate a spreadsheet. There are various validations that run prior to the data populating. On one validation if an incorrect choice has been made from a drop down box a error message prompts the user to select again form the drop down box and will not populate until a valid selection has been made. I am now getting an Excel warning message (exclamation message) saying 'Invalid Property Value' after the spreadsheet has populated which only happens if an invalid selection has been made and corrected from the drop down box. If the ...

eConnect SOP Post Procedure
Hello! We are attempting to update the batch ID of an SOP order immediately after completing the integration of that order. The logic for this update is based on whether or not any process holds exist for the order. We would prefer to run this update as a post procedure in the process hold insert (taSopUpdateCreateProcessHold), but there is no post-procedure available for this node. When we attempted to include the logic as part of the header insert (taSopHdrIvcInsert), it did not pick up the process holds... we suspect the taSopUpdateCreateProcessHold node had not yet been run at t...

Invalid Procedure Call on Forms
Hello, any suggestions are appreciated! I imported tables from our media database into our membership database. I was going to combine the information so that I could streamline orders with lookup fields but my supervisor didn't like it so... I went back to the media database and now NONE of the form buttons are working. The forms open, and all the reports, queries, and tables open without incident. However, when I click any button on any form (to call up a report, query or another form), I receive an error: "Invalid Procedure Call or Arguement". I tried creating a...

Invalid Operation 425
I know there are a few other threads pretaining to "Invalid Operation 425, Cash Drawer locked by another application" but the solutions given there have not solved our problem. We have multiple store locations with the exact same set-up but only one is having this problem . The problem happens most of the time but not always. Our set up is RMS version 2.0 Printer - Epson Tm-881V Cash Drawer - APG VB320 OPOS ADK 2.6 Running on Windows XP Pro Any body have an idea? -- Many thanks Jack Master Jack - Without taking time to go back against all old posts and see what is liste...

Renamed invalid sheet name
I have a routine that opens a workbook to access data and then closes it. It has worked fine for years with XP and Excel 2000. Since changing to Win 7 and Excel 2003 it will no longer automatically open. A warning box appears "Repairs to 'Workbook'" and the message "Renamed invalid sheet name". After closing the message box it renames the worksheet to "Recovered_Sheet 1" and opens the workbook. However, this is a manual process and I need it to be automated as before. What I have found (I believe) is that if the file name includes "...

Invalid object name when I try to create a scaler udf in a stored procedure.
I am trying to create a report that shows a company name, all the advisors in that company, then the company's stats (there should be one row for each company). Each of these come from a different table. The advisors are currently being listed as one per line, which means the company name and the stats are all being repeated unneccesarily. I want to concatinate the advisors, so that all the ones that belong to the same company show in the same cell. I wrote this UDF which is located right before my SP: CREATE FUNCTION [dbo].[ConcatAdvisorNames](@Company as varchar(20)) RETURNS VA...

Refreshing data results in "invalid cell reference"
I imported some data from a CSV into a worksheet. On another worksheet (named Chapel) I referenced the data in a formula: {=SUM(IF(Chapel!$A$1:Chapel!$A$1000=Categories!$A1, IF(Chapel!$C$1:Chapel!$C$1000=Categories!A$30,1,0),0))} This formula works fine. Now, if I go and refresh my data I get invalid references in my formula: {=SUM(IF(Chapel!$A$1:Chapel!#REF!=Categories!$A1, IF(Chapel!$E$1:Chapel!$E$1000=Categories!A$30,1,0),0))} Is there some way to make this work? And why do some references to Chapel change but others do not? Notice that the first reference to $A$1000 is now invalid...

how to use invalidate and validate
I am using DrawRectangle and SetPixel and some other drawing functions over an image displayed in the background. I'm wondering what exactly I should be doing to make sure that when my application regains focus that things were like they were when focus was lost. I'm not quite sure what the Validate functions do, which is part of the problem. -- to reply, remove Big10 from address Andrew, There is only one way to make sure that the drawing is persistant even after another application has been activated (or indeed anything else forcing a redraw, such as the display of a dialogbox)...

correct recovery procedure ex 5.5
Hi, What is the correct recovery procedure for unscrambling a 5.5 database? I have tried eseutil /p ... and /d and then isinteg ... alltests I got 9 fixes after the latter. Unfortunately the exch services still wont start, saying there are inconsistencies No backup, of course ... Any help greatly appreciated. NEIL Keep running isinteg....alltests till 0 errors/fixes -------------- Sushil Sharma Microsoft PSS "Please do not send email directly to this alias. This alias is for newsgroup purposes only." "This posting is provided "AS IS" with no warranties, and...

Invalidate
Hi, I added a control to a View. So, I believe, that when I call Invalidate(), it effects the control and I get flicker. I am not erasing the background. BOOL CViewX::OnEraseBkgnd(CDC* pDC) { return TRUE; // return CView::OnEraseBkgnd(pDC); } Is there anything else that might be causing it? Thanks, -- dbgrpt.c -1 Computer wrote: > Hi, > > I added a control to a View. > So, I believe, that when I call Invalidate(), > it effects the control and I get flicker. > > I am not erasing the background. > BOOL CViewX::OnEraseBkgnd(CDC* pDC) > { > return TRUE; ...

execute a Store Procedure using a hook
hi everyone again, i have a question about the hooks, i have a hook of type 1 and i need to execute a Store Procedure. Its possible? im asking this because when the hook is fired up by the event, it work me fine until the line of execute that sp. ...

The user Id is invalid.
I have been utterly unable to get the SDK to work for me, trying any permutation of credentials, explicit permissions and I always get the 'Server was unable to process request.' error message. I'm trying to access the CRM webservice from another machine, and web references are setup (I hope) correctly. On closer inspection this is the InnerXML field in the details of the exception: <error> <code>0x80041d1f</code> <description>The user Id is invalid.</description> <type>Platform</type> </error> The code that generates it? se...

Invalid Domain Name. Domain name invalid or unreachable
Hi, I am getting following error in MS CRM 4.0 when using Deployment Manager: "Invalid Domain Name. Domain name is either invalid or unreachable". Also when using the Plug-in registration tool, I am getting the same error. And I am not able to register any plug-in. Request you to please provide your inputs. Thanks in advance, help appreciated. Bharat ...

How to change a stored procedure
I have a stored procedure shown below, not written by me. I want it t show in desending order rather than asending so in the procedue I modified itemdate ASC, id ASC to itemdate DESC, id DESC as shown in the code below. But that didn't change what was displayed. Do I have to insert a GO after the SQL code that shows when I select Modify on the procedure? I did try that also. I don't understand what the id ASC does in that command. Can ORDER take two parameters? The change did get stored because I looked after closing and opening. But do I normall...

what does an "invalid sam id" meen in Outlook 2007?
I'm trying to import a .csv to Outlook. I keep getting "invalid sam id" message. the error with act3.sam translator message appears also. SAM = Security Access Manager and is not an Outlook related issue. Invalid SAM ID indicates a connection failure with your servers - something changed in your environment which made the SAM ID for the machine you are using invalid between the server and workstation. Are you using BCM? -- Diane Poremsky [MVP - Outlook] Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.c...

Invalid Database
I am running a small network (3-5 clients) with 1 POS lane. Each of the other computers has the RMS software installed. The master database is located ont the same computer that runs the POS. Here's the problem: When I test the database conncetion through Administrator Config. on any other computer, it says "Connection to the database is made but the database appears to be blank or not a valid Store Operations database." I don't understand how the database could be invalid if the POS is able to run from it. Secondly: When I try to open Store Operations...

Invalid Domain Name. Domain name invalid or unreachable #2
Hi, I am getting following error in MS CRM 4.0 when using Deployment Manager: "Invalid Domain Name. Domain name is either invalid or unreachable". Also when using the Plug-in registration tool, I am getting the same error. And I am not able to register any plug-in. Request you to please provide your inputs. Thanks in advance, help appreciated. Bharat On this posting there is some code to help you list the domains active from the machine you wish to install CRM 4.0 on. create this inside a .vbs file and run it using cscript from the system32 folder and it listed mine correctl...

invalid from address
Any external mail sent with invalid from address (eg. blank from address or email address not available in Active directory) are not going out through the smtp connector. Instead it is getting routed back to the internal exchange 5.5 server and being NDR'ed. Any help in this regard. Regards GP In news:erdWgmjgFHA.3788@tk2msftngp13.phx.gbl, GP <vguru@yahoo.com> typed: > Any external mail sent with invalid from address (eg. blank from > address or email address not available in Active directory) are not > going out through the smtp connector. Instead it is getting ...