Again Christopher - Thankyou
Does ASP & Cold Fusion handle this differently, as I set up a counter on an
asp version of this page and I had problems deleting old and adding new
records, once I removed the autonumber out of my database - it worked no
problems. I just assumed that similar principles would apply. I guess the
old saying on assume (ass of u & me) proves itself again.
Big Cheers
Kylie
----- Original Message -----
From: "Christopher Olive, CIO" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, November 21, 2000 11:01 PM
Subject: RE: deleting records
> yup. looks like
>
> MM_recordId = "'" & MM_recordId & "'";
>
> is your culprit. most ID fields in a DB are numbers. try removing that
> line, or, if you want to be pedantic, try
>
> MM_recordId = MM_recordId;
>
> that should work for you.
>
> chris olive, cio
> cresco technologies
> [EMAIL PROTECTED]
> http://www.crescotech.com
>
>
>
> -----Original Message-----
> From: Kylie Lovelock [mailto:[EMAIL PROTECTED]]
> Sent: Monday, November 20, 2000 9:58 PM
> To: CF-Talk
> Subject: Re: deleting records
>
>
> Here's my code, c/o UltraDev
> Thankyou Jon, Scott, Phoeun, David & Simon for your time with this.
>
> <cfscript>
> // *** Delete Record: construct a sql delete statement and execute it
> MM_editAction = CGI.SCRIPT_NAME;
> If (CGI.QUERY_STRING NEQ "") MM_editAction = MM_editAction & "?" &
> CGI.QUERY_STRING;
> If (IsDefined("MM_delete") AND IsDefined("MM_recordId")) {
>
> MM_datasource = "HCint";
> MM_username = "";
> MM_password = "";
> MM_tableName = "input";
> MM_tableCol = "HC_date";
> MM_recordId = "'" & MM_recordId & "'";
> MM_redirectPage = "int_mod2.cfm";
>
> // create the delete sql statement
> MM_deleteStr = "delete from " & MM_tableName & " where " & MM_tableCol &
"
> = " & MM_recordId;
>
> // build the redirect URL
> If (MM_redirectPage eq "") MM_redirectPage = CGI.SCRIPT_NAME;
> If (Find("?", MM_redirectPage) EQ 0 AND CGI.QUERY_STRING NEQ "")
> MM_redirectPage = MM_redirectPage & "?" & CGI.QUERY_STRING;
> }
> </cfscript>
> <cfif IsDefined("MM_delete") AND IsDefined("MM_recordId")>
> <cfquery datasource="#MM_datasource#" username="#MM_username#"
> password="#MM_password#">
> #PreserveSingleQuotes(MM_deleteStr)#
> </cfquery>
> <cflocation url="#MM_redirectPage#" addtoken="no">
> </cfif>
> <cfquery name="rsHCint" datasource="HCint" >
> SELECT * FROM input ORDER BY HC_date DESC
> </cfquery>
> <cfset rsHCint_NumRows = 0>
> <cfset rsHCint_Index = 1>
> <html>
> <head>
> <title>Untitled Document</title>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
> </head>
> <body bgcolor="#FFFFFF">
> <table width="95%" border="0" align="center">
> <tr>
> <td width="15%">
> <div align="center"><font face="Verdana, Arial, Helvetica,
sans-serif"
> size="5">Date</font></div>
> </td>
> <td width="19%">
> <div align="center"><font face="Verdana, Arial, Helvetica,
sans-serif"
> size="5">Name</font></div>
> </td>
> <td width="54%">
> <div align="center"><font face="Verdana, Arial, Helvetica,
sans-serif"
> size="5">Comment</font></div>
> </td>
> <td width="12%">
> <div align="center"><font face="Verdana, Arial, Helvetica,
sans-serif"
> size="5">Delete</font></div>
> </td>
> </tr>
> </table>
> <br>
> <table width="95%" border="0" align="center">
> <cfoutput query="rsHCint">
> <tr>
> <td width="15%" height="50">
> <div align="left"><font face="Verdana, Arial, Helvetica,
> sans-serif">#rsHCint.HC_date#</font></div>
> </td>
> <td width="19%" height="50">
> <div align="left"><font face="Verdana, Arial, Helvetica,
> sans-serif">#rsHCint.HC_name#</font></div>
> </td>
> <td width="54%" height="50">
> <div align="left"><font face="Verdana, Arial, Helvetica,
> sans-serif">#rsHCint.HC_comment#</font></div>
> </td>
> <td width="12%" height="50">
> <form name="form1" method="post" action="#MM_editAction#">
> <div align="center"><font face="Verdana, Arial, Helvetica,
> sans-serif">
> <input type="submit" name="Submit" value="Delete">
> </font> </div>
> <input type="hidden" name="MM_recordId"
value="#rsHCint.HC_date#">
> <input type="hidden" name="MM_delete" value="true">
> </form>
> </td>
> </tr>
> </cfoutput>
> </table>
> </body>
> </html>
> ----- Original Message -----
> From: "Jon Hall" <[EMAIL PROTECTED]>
> To: "CF-Talk" <[EMAIL PROTECTED]>
> Sent: Tuesday, November 21, 2000 4:36 AM
> Subject: Re: deleting records
>
>
> > Could you post the actual cfquery statement? I am thinking it's probably
> > quotes i nthe wronf place or something similar.
> >
> > jon
> > ----- Original Message -----
> > From: "Kylie Lovelock" <[EMAIL PROTECTED]>
> > To: "CF-Talk" <[EMAIL PROTECTED]>
> > Sent: Monday, November 20, 2000 11:35 AM
> > Subject: deleting records
> >
> >
> > > Evening all
> > > The continuing saga of my learning curve kinda goes like this ....
> > > I'm using UltraDev & have a page displaying all of the records in a
> > table,
> > > at the end of each record a have a form with a 'delete' button -
> > everything
> > > displays beautifully. In theory, after I deleting a record, you return
> to
> > > the same page. But I am getting this error after clicking the delete
> > button.
> > >
> > > Error Diagnostic Information
> > > ODBC Error Code = 22005 (Error in assignment)
> > >
> > > [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in
criteria
> > > expression.
> > >
> > > The error occurred while processing an element with a general
identifier
> > of
> > > (CFQUERY), occupying document position (26:1) to (26:88).
> > >
> > > My date field is the unique identifier (access general date format,
time
> > etc
> > > included as not to double up). Any ideas where I'm going wrong?
> > >
> > > Thanks for your time
> > >
> > > Cheers
> > > Kylie Lovelock
> > >
> > > When confronted by a difficult problem, you can solve it easily by
> > > reducing the question to, "How would the Lone Ranger handle this?"
> > >
> > >
> > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > Structure your ColdFusion code with Fusebox. Get the official book at
> > http://www.fusionauthority.com/bkinfo.cfm
> > >
> > > Archives: http://www.mail-archive.com/[email protected]/
> > > Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
> >
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > Structure your ColdFusion code with Fusebox. Get the official book at
> http://www.fusionauthority.com/bkinfo.cfm
> >
> > Archives: http://www.mail-archive.com/[email protected]/
> > Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
> >
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Structure your ColdFusion code with Fusebox. Get the official book at
> http://www.fusionauthority.com/bkinfo.cfm
>
> Archives: http://www.mail-archive.com/[email protected]/
> Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
>
> Archives: http://www.mail-archive.com/[email protected]/
> Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists