Ask a Question related to Coldfusion Database Access, Design and Development.
-
UpstateWeb #1
Problem Adding Columns to multiple datasources?
I am using 6.1 updated, MS Access 2003, Windows Webserver 2003. Can anyone see
a problem with my code. I am trying to find a better way to update columns in
multiple datasources:
<cfset VARIABLES.thislist = "tableone, tabletwo, tablethree, tablefour">
<cfloop index="ThisIndex" list="#VARIABLES.thislist#">
<cfoutput>#ThisIndex#</cfoutput>
<cfquery name="testServices" datasource="#ThisIndex#">
SELECT * FROM Services
</cfquery>
<cfoutput>#testServices.ColumnList#</cfoutput>
<cfif
ListContainsNoCase("#testServices.ColumnList#","do cumentFileName")>#ThisIndex
already has formfield<cfelse>
<cfquery datasource="#ThisIndex#">
ALTER TABLE Services ADD COLUMN documentFileName text(255) NULL;
</cfquery>
</cfif>
</cfloop>
Thanks in advance,
Rock Moore
UpstateWeb Guest
-
problem whil adding user control dynamically multiple times
I have two buttons add and save on my aspx page as and when i click on save button ,i want to load user control on form it works fine but when i... -
Multiple datasources, one webpage?
I have a MS Access database in which a have a daily query for each day of the year that shows tennis court reservations for that day. I have a... -
Adding Custom Columns to DataGrid
Hi, I populate a DataGrid with the result returned by my webservice. Currently I have 3 columns displayed in the DataGrid , say FName,LName, and... -
Adding columns dynamically
hi, I always get the error: Item has already been added. Key in dictionary: "0" Key being added: "0" ----when trying to databind the webgrid with... -
How to bind multiple datasources to one grid?
How can I bind my grid to more than one datasource - that is the question. Right now I bind to a DataView table that has a single DataTable as its... -
Dan Bracuk #2
Re: Problem Adding Columns to multiple datasources?
Take away the spaces following the commas in you thislist variable.
Originally posted by: UpstateWeb
I am using 6.1 updated, MS Access 2003, Windows Webserver 2003. Can anyone see
a problem with my code. I am trying to find a better way to update columns in
multiple datasources:
<cfset VARIABLES.thislist = "tableone, tabletwo, tablethree, tablefour">
<cfloop index="ThisIndex" list="#VARIABLES.thislist#">
<cfoutput>#ThisIndex#</cfoutput>
<cfquery name="testServices" datasource="#ThisIndex#">
SELECT * FROM Services
</cfquery>
<cfoutput>#testServices.ColumnList#</cfoutput>
<cfif
ListContainsNoCase("#testServices.ColumnList#","do cumentFileName")>#ThisIndex
already has formfield<cfelse>
<cfquery datasource="#ThisIndex#">
ALTER TABLE Services ADD COLUMN documentFileName text(255) NULL;
</cfquery>
</cfif>
</cfloop>
Thanks in advance,
Rock Moore
Dan Bracuk Guest
-
UpstateWeb #3
Re: Problem Adding Columns to multiple datasources?
OK. I feel like an idiot. I have had spaces before, i think? Did 4.5 allow spaces?
Thanks,
That worked!
Rock Moore
UpstateWeb Guest
-
Dan Bracuk #4
Re: Problem Adding Columns to multiple datasources?
You can have spaces. They just get included as part of the list element, no matter where they appear.
Dan Bracuk Guest



Reply With Quote

