Undeclared namespace

J

Joanne

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
 
J

Joanne

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.

Zhang Haiguang said:
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]

Joanne said:
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
 
Z

Zhang Haiguang

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

Joanne said:
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.

Zhang Haiguang said:
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]

Joanne said:
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
 
Z

Zhang Haiguang

There is a good demo about namespacesDefinition post by jesse in the
article:
http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=4420&#13352

Zhang Haiguang said:
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

Joanne said:
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.

Zhang Haiguang said:
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
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
 
J

Joanne

Thank you so much. You have been incredibly helpful

Zhang Haiguang said:
There is a good demo about namespacesDefinition post by jesse in the
article:
http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=4420&#13352

Zhang Haiguang said:
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

Joanne said:
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:
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
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
 
J

Joanne

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

Joanne said:
Thank you so much. You have been incredibly helpful

Zhang Haiguang said:
There is a good demo about namespacesDefinition post by jesse in the
article:
http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=4420&#13352

Zhang Haiguang said:
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?
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:
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
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
 
Z

Zhang Haiguang

Please reference:
http://www.developerfusion.co.uk/forums/thread/100408/#100408

Joanne said:
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

Joanne said:
Thank you so much. You have been incredibly helpful

Zhang Haiguang said:
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:
'<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?
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:
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
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
 
Z

Zhang Haiguang

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top