By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,635 Members | 911 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,635 IT Pros & Developers. It's quick & easy.

Passing XML DoubleQuotes to Sproc

P: n/a
I can pass the XML below to a sproc from within a vb.net application
but it doesn't work to the same sproc from an Access application.

I've tried massaging the double quotes without success. Any help is
appreciated.

lq

XML text:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<geonames style="FULL">
<totalResultsCount>3</totalResultsCount>
<geoname>
<name>South Pasadena</name>
<lat>34.1161196</lat>
<lng>-118.1503488</lng>
<geonameId>5397717</geonameId>
<countryCode>US</countryCode>
<countryName>United States</countryName>
<fcl>P</fcl>
<fcode>PPL</fcode>
<fclName>city, village,...</fclName>
<fcodeName>populated place</fcodeName>
<population>24994</population>
<alternateNames/>
<elevation>201</elevation>
<adminCode1>CA</adminCode1>
<adminName1>California</adminName1>
<adminCode2>037</adminCode2>
<adminName2>Los Angeles County</adminName2>
<timezone dstOffset="-7.0" gmtOffset="-8.0">America/Los_Angeles</
timezone>
</geoname>
</geonames>
Jan 7 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Jan 7, 5:42 pm, Lauren Quantrell <laurenquantr...@hotmail.com>
wrote:
I can pass the XML below to a sproc from within a vb.net application
but it doesn't work to the same sproc from an Access application.

I've tried massaging the double quotes without success. Any help is
appreciated.

lq

XML text:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<geonames style="FULL">
<totalResultsCount>3</totalResultsCount>
<geoname>
<name>South Pasadena</name>
<lat>34.1161196</lat>
<lng>-118.1503488</lng>
<geonameId>5397717</geonameId>
<countryCode>US</countryCode>
<countryName>United States</countryName>
<fcl>P</fcl>
<fcode>PPL</fcode>
<fclName>city, village,...</fclName>
<fcodeName>populated place</fcodeName>
<population>24994</population>
<alternateNames/>
<elevation>201</elevation>
<adminCode1>CA</adminCode1>
<adminName1>California</adminName1>
<adminCode2>037</adminCode2>
<adminName2>Los Angeles County</adminName2>
<timezone dstOffset="-7.0" gmtOffset="-8.0">America/Los_Angeles</
timezone>
</geoname>
</geonames>
Are you using a variable pointing to the string?
Are you using an ado command object and a parameter?
I believe that you will be successful if you do.

eg

With m
.ActiveConnection = CurrentProject.Connection
.CommandType = adCmdStoredProc
.CommandText = "StoredProcedure2"
Set p = .CreateParameter("@SomeString", adVarChar, adParamInput,
2000, msXml.ResponseText)
.Parameters.Append p
End With

In this case, msXml.ResponseText points to the string.
Jan 8 '08 #2

P: n/a
On Jan 7, 9:14*pm, lyle <lyle.fairfi...@gmail.comwrote:
On Jan 7, 5:42 pm, Lauren Quantrell <laurenquantr...@hotmail.com>
wrote:


I can pass the XML below to a sproc from within a vb.net application
but it doesn't work to the same sproc from an Access application.
I've tried massaging the double quotes without success. Any help is
appreciated.
lq
XML text:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<geonames style="FULL">
<totalResultsCount>3</totalResultsCount>
<geoname>
<name>South Pasadena</name>
<lat>34.1161196</lat>
<lng>-118.1503488</lng>
<geonameId>5397717</geonameId>
<countryCode>US</countryCode>
<countryName>United States</countryName>
<fcl>P</fcl>
<fcode>PPL</fcode>
<fclName>city, village,...</fclName>
<fcodeName>populated place</fcodeName>
<population>24994</population>
<alternateNames/>
<elevation>201</elevation>
<adminCode1>CA</adminCode1>
<adminName1>California</adminName1>
<adminCode2>037</adminCode2>
<adminName2>Los Angeles County</adminName2>
<timezone dstOffset="-7.0" gmtOffset="-8.0">America/Los_Angeles</
timezone>
</geoname>
</geonames>

Are you using a variable pointing to the string?
Are you using an ado command object and a parameter?
I believe that you will be successful if you do.

eg

With m
* * .ActiveConnection = CurrentProject.Connection
* * .CommandType = adCmdStoredProc
* * .CommandText = "StoredProcedure2"
* * Set p = .CreateParameter("@SomeString", adVarChar, adParamInput,
2000, msXml.ResponseText)
* * .Parameters.Append p
End With

In this case, msXml.ResponseText points to the string.- Hide quoted text -

- Show quoted text -
I see now. I was trying it with a declared string value:

Dim myWebServiceReturn as string
Dim RS As Recordset
Dim mySprocName as string

myWebServiceReturn =
FunctionNameThatCallsWebServiceAsXMLString(params)

Set RS = CurrentProject.Connection.Execute("EXEC " & mySprocName & "
'" & myWebServiceReturn & "'")
Me.ComboBox.RowSource = RS.Source
Jan 8 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.