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

  1. #1

    Default updating database

    I posted this in the general dis part too but maybe this
    is better place since it has to do with forms...

    here is my problem I need to overcome.

    I have a registration webpage which is a form. once
    someone submits the information on that page and clicks
    submit, I need the information to update a access database
    which i have, .mbd file? I am using dreamweaver to create
    my pages, and microsoft access table where the date needs
    to go. It will be going on a 2000 NT server.

    anyhelp or direction would be Great, Please E-mail me any
    info;
    [email]MoparMarc@hotmail.com[/email]

    Thanks
    MoparMarc

    MoparMarc Guest

  2. Similar Questions and Discussions

    1. updating a database.
      at the moment is am trying to create a page to update a database. i select the a company in a list which the gets forwarded to the next page. On...
    2. MS Access Database not Updating
      Hi, I am working on creating dynamic home pages with Coldfusion MX on the server, Dreamweaver for developing and Microsoft Access as the backend...
    3. Updating a Database
      Hi I am just learning asp.net and have hit a wall with the datagrid control. I have populated a datagrid and am able to edit fields and retrieve...
    4. SQL not Updating Access Database
      Hi, I have an ASP page that updates an Access 2000 database. It doesnt seem to update the date field of the table. Here is the SQL: Update...
    5. Updating Database with ASP
      Hi, I'm just learning how to use ASP and I've been trying to figure out how to add records to my database. I'm learning it out of a book and...
  3. #2

    Default updating database

    When you do a SELECT on a database table, you can also get the record count
    (i.e., queryName.RecordCount).

    I was wondering if you can get the same value, or something similar, if I were
    to perform an UPDATE? In other words ... can I confirm if the update was
    sucessful, without having to do a select on that table?



    binhtri Guest

  4. #3

    Default Re: updating database

    Unfortunately, this won't work. You will need to do the select first and do the update if results are returned, otherwise do your insert.
    TA-Selene Guest

  5. #4

    Default Re: updating database

    Well ... that's a bummer. Was hoping I could avoid tapping the db. Regardless, thanks Team Macramedia Volunteer.
    binhtri Guest

  6. #5

    Default Re: updating database

    Hi there,

    In SQL Server there is a system variable @@ROWCOUNT that returns the number of
    rows affected by the last operation. You can SELECT this value at the end of
    your update to return how many records were affected.

    The SET NOCOUNT ON just stops the normal system message of "n rows were
    affected" from being returned as text (which is what happens when you run the
    query in Query analyser) - allowing the query just to return the value of
    @@ROWCOUNT

    Cheers

    Andy

    <cfquery name="updData" datasource="#request.ds#">
    SET NOCOUNT ON
    UPDATE tblTable
    SET fieldname = fieldname + 1
    WHERE otherfield = 0

    SELECT @@ROWCOUNT AS numRows
    </cfquery>
    <cfoutput>#updData.numRows# were updated</cfoutput>

    Chugglethwaite Guest

  7. #6

    Default Updating database

    Hi folks, I need hel. I am trying to populate a database table with the query
    below:
    <CFQUERY name="MOdifyForex" datasource="#dbase#" dbtype="ODBC">
    UPDATE tblCADForex
    SET
    tblCADDate = '#form.tblCADDate#',
    Currency = '#form.Currency#',
    BuyingRate = '#form.BuyingRate#',
    SellingRate = '#form.SellingRate#',
    CurrencyName = '#form.CurrencyName#',
    CurrencyCountry = '#form.CurrencyCountry#',
    Flag = '#form.Flag#'
    WHERE tblForexID = #form.tblForexID#
    </CFQUERY>

    However I keep getting "Syntax error in UPDATE statement." My confusion is
    that I have used this same query in other instances and it worked perfectly.
    Can somebody help me out? Thanks

    chrisdonkor Guest

  8. #7

    Default Re: Updating database

    Currency is a reserved word in some databases, but that is not necessarily the
    problem here...

    What database are you using? Can you post the actual SQL query from error
    message. It should show the form field values that were sent to the database.

    mxstu 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