Problem Adding Columns to multiple datasources?

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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...
    2. 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...
    3. 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...
    4. 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...
    5. 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...
  3. #2

    Default 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

  4. #3

    Default 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

  5. #4

    Default 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139