Passing XML DoubleQuotes to Sproc
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>
Re: Passing XML DoubleQuotes to Sproc
On Jan 7, 5:42 pm, Lauren Quantrell <laurenquantr... [at] 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(" [at] SomeString", adVarChar, adParamInput,
2000, msXml.ResponseText)
.Parameters.Append p
End With
In this case, msXml.ResponseText points to the string.
Re: Passing XML DoubleQuotes to Sproc
On Jan 7, 9:14=A0pm, lyle <lyle.fairfi... [at] gmail.com> wrote:
> On Jan 7, 5:42 pm, Lauren Quantrell <laurenquantr... [at] 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=3D"1.0" encoding=3D"UTF-8" standalone=3D"no"?>
> > <geonames style=3D"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=3D"-7.0" gmtOffset=3D"-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
> =A0 =A0 .ActiveConnection =3D CurrentProject.Connection
> =A0 =A0 .CommandType =3D adCmdStoredProc
> =A0 =A0 .CommandText =3D "StoredProcedure2"
> =A0 =A0 Set p =3D .CreateParameter(" [at] SomeString", adVarChar, adParamInput,=
> 2000, msXml.ResponseText)
> =A0 =A0 .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 =3D
FunctionNameThatCallsWebServiceAsXMLString(params)
Set RS =3D CurrentProject.Connection.Execute("EXEC " & mySprocName & "
'" & myWebServiceReturn & "'")
Me.ComboBox.RowSource =3D RS.Source