troubleshooting Question

Insert New Record into MS Access

Avatar of Nigel-SA
Nigel-SA asked on
Microsoft AccessWeb Servers
7 Comments2 Solutions1388 ViewsLast Modified:
HELP URGENT, I'm trying to insert a new record into ms access database for a survey, but current code below only updates the same record.  I know this is simple but can't get it adding new record and it needs to be done by today.  The AutoID is set to primary field in database, with "Number" not "Autonumber" as data type.   thanks

<cfset ds="nlfcsdb">

<cfquery name="key" datasource="#ds#">
select max(AutoID) as AutoIDhold from nlfcssurvey
</cfquery>

<cfset holdtemp = #key.AutoIDhold#>

  <!--- Update survey Details --->
  <cfquery name="keytest" datasource="#ds#">
 
  UPDATE nlfcssurvey
 
  SET
 
  AutoID=#holdtemp#+1,
  Academics='#Trim(ARGUMENTS.Academics)#',
  AcademicsComments='#Trim(ARGUMENTS.AcademicsComments)#',
  Faculty='#Trim(ARGUMENTS.Faculty)#',
  FacultyComments='#Trim(ARGUMENTS.FacultyComments)#',
  Athletics='#Trim(ARGUMENTS.Athletics)#',
  AthleticsComments='#Trim(ARGUMENTS.AthleticsComments)#',
  Spiritualvitality='#Trim(ARGUMENTS.Spiritualvitality)#',
  SpiritualvitalityComments='#Trim(ARGUMENTS.SpiritualvitalityComments)#',
  Facilities='#Trim(ARGUMENTS.Facilities)#',
  FacilitiesComments='#Trim(ARGUMENTS.FacilitiesComments)#',
  otherComments='#Trim(ARGUMENTS.otherComments)#',
  resource='#Trim(ARGUMENTS.resource)#',
  cur_datetime= #CreateODBCDate(ARGUMENTS.cur_datetime)#,
  name='#Trim(ARGUMENTS.name)#'
 
  </cfquery>
ASKER CERTIFIED SOLUTION
Wim

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros