Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / March 2007

Tip: Looking for answers? Try searching our database.

Undeclared namespace

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Joanne - 09 Mar 2007 21:19 GMT
Hello, Could someone tell me what's wrong with this code?  I can't see that
there is anything wrong.

Sub XDocument_OnLoad(eventObj)

Set objNet = CreateObject("WScript.NetWork")    
Dim strInfo
strInfo = objNet.UserName        

Dim strOrigSQLCommand
Dim strTitle
Dim strSQLCommand
Dim strSupplierID
Dim querySuppliers

strOrigSQLCommand=XDocument.QueryAdapter.Command
set
querySuppliers=XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:queryFields/q:Suppliers")

'MsgBox strOrigSQLCommand
'MsgBox strInfo

End Su
Zhang Haiguang - 10 Mar 2007 14:07 GMT
Please check the <InfoPathNamespace(" ... ")> section in the header of your
FormCode.vb, and ensure the presence of the following xmlns declarations:
xmlns:q=""http://schemas.microsoft.com/office/infopath/2003/ado/queryFields""
xmlns:d=""http://schemas.microsoft.com/office/infopath/2003/ado/dataFields""
xmlns:dfs=""http://schemas.microsoft.com/office/infopath/2003/dataFormSolution""

InfoJet Serivce,
InfoPath Web Form,
[http://www.infojetsoft.com]

> Hello, Could someone tell me what's wrong with this code?  I can't see
> that
[quoted text clipped - 20 lines]
>
> End Su
Joanne - 10 Mar 2007 15:16 GMT
Thank you so much for your response.  I'm sorry - I'm VERY new to Infopath
(about two weeks) but where is my formcode.vb?  And where is the header?  
Thank you for your patience.

> Please check the <InfoPathNamespace(" ... ")> section in the header of your
> FormCode.vb, and ensure the presence of the following xmlns declarations:
[quoted text clipped - 30 lines]
> >
> > End Su
Zhang Haiguang - 10 Mar 2007 15:49 GMT
Sorry, are you using VBScript? rather than VB.NET?
If you are using VBScript, please add the following code:
'<namespacesDefinition>
XDocument.DOM.setProperty "SelectionNamespaces",
"xmlns:q=""http://schemas.microsoft.com/office/infopath/2003/ado/queryFields""
xmlns:d=""http://schemas.microsoft.com/office/infopath/2003/ado/dataFields""
xmlns:dfs=""http://schemas.microsoft.com/office/infopath/2003/dataFormSolution""
xmlns:my=""http://schemas.microsoft.com/office/infopath/2003/myXSD/2007-03-10T15:43:11""
xmlns:xdado=""http://schemas.microsoft.com/office/infopath/2003/adomapping"""
'<namespacesDefinition>
Please replace the declaration xmlns:my with your namespace uri or remove
it.
The code should be generated by InfoPath 2007 automatically...
Please reference the article
http://www.officehelp.in/98655/dataconnection-data

> Thank you so much for your response.  I'm sorry - I'm VERY new to Infopath
> (about two weeks) but where is my formcode.vb?  And where is the header?
[quoted text clipped - 35 lines]
>> >
>> > End Su
Zhang Haiguang - 10 Mar 2007 16:16 GMT
There is a good demo about namespacesDefinition post by jesse in the
article:
http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=4420&#13352

> Sorry, are you using VBScript? rather than VB.NET?
> If you are using VBScript, please add the following code:
[quoted text clipped - 53 lines]
>>> >
>>> > End Su
Joanne - 12 Mar 2007 17:43 GMT
Thank you so much.  You have been incredibly helpful

> There is a good demo about namespacesDefinition post by jesse in the
> article:
[quoted text clipped - 57 lines]
> >>> >
> >>> > End Su
Joanne - 12 Mar 2007 23:08 GMT
Hello,
I put all the code in that you suggested and it still doesn't work. It's
querying an Access database.  This is what I have.  It's just driving me
crazy.
Set objNet = CreateObject("WScript.NetWork")
Dim StrInfo
Dim strOrigSQLCommand
Dim querySuppliers

strInfo = objNet.UserName        
strOrigSQLCommand=XDocument.QueryAdapter.Command
querySuppliers=XDocument.DOM.selectSingleNode(/dfs:myFields/my:queryFields/my:Suppliers)

MsgBox strInfo

> Thank you so much.  You have been incredibly helpful
>
[quoted text clipped - 59 lines]
> > >>> >
> > >>> > End Su
Zhang Haiguang - 13 Mar 2007 04:31 GMT
Please reference:
http://www.developerfusion.co.uk/forums/thread/100408/#100408

> Hello,
> I put all the code in that you suggested and it still doesn't work. It's
[quoted text clipped - 78 lines]
>> > >>> >
>> > >>> > End Su
Zhang Haiguang - 13 Mar 2007 11:23 GMT
Hi,
Please reference the following code to query by main data connection:
function CTRL6_7::OnClick(eventObj)
{
XDocument.UI.Alert(XDocument.QueryAdapter.Command);
XDocument.QueryAdapter.Command = XDocument.QueryAdapter.Command + " where 1
= 1";
// Replace your condition in where clause.
try
{
 XDocument.Query();
 XDocument.UI.Alert("selected");
}
catch(ex)
{
 XDocument.UI.Alert("Name not in database or invalid return./n/n" +
ex.number + " " + ex.description);
}
}
And the following two article maybe is helpful:
http://www.developerfusion.co.uk/forums/thread/100408
http://www.developpez.net/forums/archive/index.php/t-140805.html

InfoJet Service
InfoPath Web Form
http://www.infojetsoft.com
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.