Yep, that was it... I had stupidly put ID instead of what the actual
field was called, which is propertyID!!  Thanks for that. :)

I'm just getting back into CF again after having been away from this
list for some time while on travels.

Cheers,

Stu

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Steve
Onnis
Sent: Saturday, 5 April 2003 7:10 AM
To: CFAussie Mailing List
Subject: [cfaussie] Re: Retrieving Last Record Inserted.

Well the query looks fine

Whats the ID column called in the table your inserting into?

Also am a little suspicious about the table being called "Properties"
aswell

Steve

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Stuart Kidd
Sent: Sunday, 6 April 2003 1:03 AM
To: CFAussie Mailing List
Subject: [cfaussie] Re: Retrieving Last Record Inserted.


Hi,

The error I'm getting is:

Error Executing Database Query.
[MERANT][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft
Access Driver] Too few parameters. Expected 1.

The Error Occurred in
E:\Inetpub\wwwroot\totalbreaks\index_totalhouses.cfm: line 275

273 :   SELECT MAX(ID) AS ThisID
274 :   FROM Properties
275 : </cfquery>
276 :
277 :           Thank you.  An email will be sent to you shortly asking
you to verify your email address.



------------------------------------------------------------------------
--------

SQL    SELECT MAX(ID) AS ThisID FROM Properties
DATASOURCE   MyTotalhouses
VENDORERRORCODE   -3010
SQLSTATE   07002

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Eugene
Gorman
Sent: Wednesday, 5 April 2000 8:02 AM
To: CFAussie Mailing List
Subject: [cfaussie] Re: Retrieving Last Record Inserted.

What error are you getting?

Eugene Gorman
http://www.velvetsystems.com

At 06:49 AM 4/5/2003 -0800, you wrote:
>Hi guys,
>
>I'm trying to find out what the last record number was that I inserted
>but am coming up with some errors.  I first have inserted the fields
and
>then I am calling another query to select the max row.  Can anybody
shed
>any light on this.
>
><cfquery name="InsertNewProperty" datasource="MyTotalHouses">
>  insert into properties (propertyfirstname, propertylastname,
>propertytype, propertytitle, propertynumberofbedrooms, propertytown,
>propertystate, propertycountry, propertyowneremailaddress,
>propertyprice, propertypriceperiod, propertypricecurrency,
>randomconfirmationnumber)
>values ('#form.propertyfirstname#', '#form.propertylastname#',
>'#form.propertytype#', '#form.propertytitle#',
>'#form.propertynumberofbedrooms#', '#form.propertytown#',
>'#form.propertystate#', '#form.propertycountry#',
>'#form.propertyowneremailaddress#', '#form.propertyprice#',
>'#form.propertypriceperiod#', '#form.propertypricecurrency#',
>'#randomconfirmationnumber#')
></cfquery>
>
><cfquery datasource="MyTotalhouses" name="GetID">
>  SELECT MAX(ID) AS ThisID
>  FROM Properties
></cfquery>
>
><cfoutput>Last record number inserted: #GetID.ThisID#</cfoutput>
>
>Thanks very much.
>
>Stu
>
>
>
>---
>You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
>To unsubscribe send a blank email to
[EMAIL PROTECTED]
>
>MX Downunder AsiaPac DevCon - http://mxdu.com/


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to
[EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/



---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to
[EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to
[EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/



---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/

Reply via email to