Showing posts with label fairly. Show all posts
Showing posts with label fairly. Show all posts

Friday, March 30, 2012

HELP!!! Creating Nested Data in Repeated Region Problem

Hi All, Would appreciate some assistance with the attached, I'm using some fairly complicated recordsets (ASP VBScript) for a property search website, I have a page where a user selects search by County this in turn takes them to a page which lists all the towns in the county and number of live properties in each, I'm using 4 recordsets for this - 3 of which list the towns (townsA2I, townsJ2R & townsS2Z) the 4th is a Property Count, examples of the recordsets are below (using townsAtoI and LiveProperties -

TownsA2I

<%
Dim TownA2I
Dim TownA2I_numRows

Set TownA2I = Server.CreateObject("ADODB.Recordset")
TownA2I.ActiveConnection = MM_recruta2_STRING
TownA2I.Source = "SELECT towncountyID, Town, County FROM dbo.easytolettowncounty WHERE Town LIKE 'A%' AND County = '" + Replace(TownA2I__MMColParam, "'", "''") + "' OR Town LIKE 'B%' AND County = '" + Replace(TownA2I__MMColParam1, "'", "''") + "' OR Town LIKE 'C%' AND County = '" + Replace(TownA2I__MMColParam2, "'", "''") + "' OR Town LIKE 'D%' AND County = '" + Replace(TownA2I__MMColParam3, "'", "''") + "' OR Town LIKE 'E%' AND County = '" + Replace(TownA2I__MMColParam4, "'", "''") + "' OR Town LIKE 'F%' AND County = '" + Replace(TownA2I__MMColParam5, "'", "''") + "' OR Town LIKE 'G%' AND County = '" + Replace(TownA2I__MMColParam6, "'", "''") + "' OR Town LIKE 'H%' AND County = '" + Replace(TownA2I__MMColParam7, "'", "''") + "' OR Town LIKE 'I%' AND County = '" + Replace(TownA2I__MMColParam8, "'", "''") + "' ORDER BY Town ASC"
TownA2I.CursorType = 0
TownA2I.CursorLocation = 2
TownA2I.LockType = 1
TownA2I.Open()

TownA2I_numRows = 0
%>

LiveProperties

<%
Dim LiveProperties
Dim LiveProperties_numRows

Sub sLivePropertyCount(vLocation)
vCount=0

Set LiveProperties = Server.CreateObject("ADODB.Recordset")
LiveProperties.ActiveConnection = MM_recruta2_STRING
LiveProperties.Source = "SELECT COUNT(PropertyID) As NumberofProperties, propertylive, propertylocation FROM dbo.easytoletproperty WHERE propertylive = 'y' AND propertylocation = " & vLocation & " GROUP BY propertylocation, propertylive"
LiveProperties.CursorType = 0
LiveProperties.CursorLocation = 2
LiveProperties.LockType = 1
LiveProperties.Open()

vCount=(LiveProperties("NumberofProperties"))
Response.write(vCount)

LiveProperties.Close()
Set LiveProperties = Nothing
end sub

LiveProperties_numRows = 0
%>

I've tried following the tutorial here http://www.webthang.co.uk/tuts/tuts_dmx/rob9/rob9.asp but when i review the page i get the following error -

"Microsoft OLE DB Provider for SQL Server error '80040e14'

Invalid column name 'Barnet'.

/PropertiesbyTown1.asp, line 338 "

Where line 338"

Where line 338 is the "LiveProperties.Open()" of the above recordset, when i try to view bindings on this recordset Dreamweaver gives me the following errors -

"Column 'dbo.easytoletproperty.propertylive' is invalid in the select list because it is not contained in an aggregate function and there is no GROUP BY clause.

Column 'dbo.easytoletproperty.propertylocation' is invalid in the select list because it is not contained in an aggregate function and there is no GROUP BY clause."

I would appreciate any assistance -

Try adding propertylocation to the GROUP BY clause as indicated by the error message.

Friday, February 24, 2012

Help with XML to Excel

Hi All,
I have a fairly complex XML file which I wanted to load to a table
using BulkLoad. However, BulkLoad has limitations when it comes to
error in the XML file (if data is bad, it stops).
After doing some research, I found out that if I have a file, say,
Books.xml and I open it in Excel (right click, open with Excel), it
does exactly what I want. I have the entire XML into my excel sheet,
with all the columns headers. It requires no schema at all.
My question is how Excel does this? How does it convert the XML into
the Excel sheet? If I can get that component of Excel that does it,
that will help me a lot. The reason is I do not want to use Excel while
I am loading my XML file into the table. I just want to know how the
Excel does it without schema, and I can do the same to export it into
the table as is.
If Bulk Load did not have the limitation, I would go for Bulk Load, but
the above conversion of xml to excel is even better if I can figure out
how it is done.
I am using Windows XP with MS Excel 2003.
Please help,
Thanks,
ChrisThere are several tools that can help you here. Part of GotDotNet, there is
a tool that will generate an XSD schema for your Xml document. The tool is
here:
http://apps.gotdotnet.com/xmltools/xsdinference/
You can later on apply couple of annotations in the XSD to make Bulkload
work with the generated schema. This should be pretty straightforward since
you want to generate a single table from your Xml Document. Just put
sql:is-constant="1" on the container elements if you have any and you are
good to go.
Bertan ARI
This posting is provided "AS IS" with no warranties, and confers no rights.
<undoredo@.gmail.com> wrote in message
news:1113421813.353131.241690@.o13g2000cwo.googlegroups.com...
> Hi All,
> I have a fairly complex XML file which I wanted to load to a table
> using BulkLoad. However, BulkLoad has limitations when it comes to
> error in the XML file (if data is bad, it stops).
> After doing some research, I found out that if I have a file, say,
> Books.xml and I open it in Excel (right click, open with Excel), it
> does exactly what I want. I have the entire XML into my excel sheet,
> with all the columns headers. It requires no schema at all.
> My question is how Excel does this? How does it convert the XML into
> the Excel sheet? If I can get that component of Excel that does it,
> that will help me a lot. The reason is I do not want to use Excel while
> I am loading my XML file into the table. I just want to know how the
> Excel does it without schema, and I can do the same to export it into
> the table as is.
> If Bulk Load did not have the limitation, I would go for Bulk Load, but
> the above conversion of xml to excel is even better if I can figure out
> how it is done.
> I am using Windows XP with MS Excel 2003.
> Please help,
> Thanks,
> Chris
>

Help with XML to Excel

Hi All,
I have a fairly complex XML file which I wanted to load to a table
using BulkLoad. However, BulkLoad has limitations when it comes to
error in the XML file (if data is bad, it stops).
After doing some research, I found out that if I have a file, say,
Books.xml and I open it in Excel (right click, open with Excel), it
does exactly what I want. I have the entire XML into my excel sheet,
with all the columns headers. It requires no schema at all.
My question is how Excel does this? How does it convert the XML into
the Excel sheet? If I can get that component of Excel that does it,
that will help me a lot. The reason is I do not want to use Excel while
I am loading my XML file into the table. I just want to know how the
Excel does it without schema, and I can do the same to export it into
the table as is.
If Bulk Load did not have the limitation, I would go for Bulk Load, but
the above conversion of xml to excel is even better if I can figure out
how it is done.
I am using Windows XP with MS Excel 2003.
Please help,
Thanks,
Chris
There are several tools that can help you here. Part of GotDotNet, there is
a tool that will generate an XSD schema for your Xml document. The tool is
here:
http://apps.gotdotnet.com/xmltools/xsdinference/
You can later on apply couple of annotations in the XSD to make Bulkload
work with the generated schema. This should be pretty straightforward since
you want to generate a single table from your Xml Document. Just put
sql:is-constant="1" on the container elements if you have any and you are
good to go.
Bertan ARI
This posting is provided "AS IS" with no warranties, and confers no rights.
<undoredo@.gmail.com> wrote in message
news:1113421813.353131.241690@.o13g2000cwo.googlegr oups.com...
> Hi All,
> I have a fairly complex XML file which I wanted to load to a table
> using BulkLoad. However, BulkLoad has limitations when it comes to
> error in the XML file (if data is bad, it stops).
> After doing some research, I found out that if I have a file, say,
> Books.xml and I open it in Excel (right click, open with Excel), it
> does exactly what I want. I have the entire XML into my excel sheet,
> with all the columns headers. It requires no schema at all.
> My question is how Excel does this? How does it convert the XML into
> the Excel sheet? If I can get that component of Excel that does it,
> that will help me a lot. The reason is I do not want to use Excel while
> I am loading my XML file into the table. I just want to know how the
> Excel does it without schema, and I can do the same to export it into
> the table as is.
> If Bulk Load did not have the limitation, I would go for Bulk Load, but
> the above conversion of xml to excel is even better if I can figure out
> how it is done.
> I am using Windows XP with MS Excel 2003.
> Please help,
> Thanks,
> Chris
>