Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with ODBC S1000 error.

Status
Not open for further replies.

koopmaun

Programmer
Jul 13, 2000
2
CA
I am attempting to delete a record from a table using the following code. I can successfully add records to this table but continue to receive ODBC Error Code=S1000 errors when I try to delete from the table. <br><br>Here is the setup code which queries my table (equipmen) and list all the job categories the individual has based on the name provided in a submitted form. <br><br>Getjobs.cfm code:<br><br>&lt;CFQUERY NAME=&quot;jobs&quot; DATASOURCE=&quot;PW_Personnel&quot;&gt;<br>&nbsp;&nbsp;SELECT FIRST, LAST, TITLE, EQUIP, SENDATE, STATUS,&nbsp;&nbsp;&nbsp;APPDATE, POSTINGNO from equipmen<br>&nbsp;&nbsp;where last='#Form.lname#' AND first='#Form.fname#' <br>&lt;/CFQUERY&gt;<br><br>&lt;!--- response to client ---&gt;<br>&lt;!--- check for empty recordset first ---&gt;<br>&lt;cfif #jobs.RecordCount# is 0&gt;<br>&nbsp;&nbsp;&lt;center&gt;&lt;h2&gt;Unable to find the information you requested!&lt;/h2&gt;&lt;p&gt;<br>&nbsp;&nbsp;Try another name in the form above!<br>&lt;cfelse&gt;<br>&nbsp;&nbsp;&lt;HTML&gt;<br>&nbsp;&nbsp;&lt;HEAD&gt;<br>&nbsp;&nbsp;&lt;TITLE&gt;Public Works Job Postings&lt;/TITLE&gt;<br>&nbsp;&nbsp;<br><br>&lt;script LANGUAGE=JAVASCRIPT&gt;<br><br>&lt;!--<br><br>function&nbsp;&nbsp;_CF_checkgetquestion(_CF_this)<br><br>&nbsp;&nbsp;&nbsp;&nbsp;{<br><br>&nbsp;&nbsp;&nbsp;&nbsp;return true;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;}<br><br><br>//--&gt;<br><br>&lt;/script&gt;<br><br>&lt;/HEAD&gt;<br>&nbsp;&nbsp;&lt;body bgcolor=white&gt;<br>&nbsp;&nbsp;&lt;center&gt; <br>&nbsp;&nbsp;&lt;table border=0 width=80%&gt;<br>&nbsp;&nbsp;&lt;tr bgcolor=burlywood&gt;&lt;th colspan=6&gt;&lt;font size=+1&gt; Postings for: &lt;cfoutput&gt;#Form.fname# #Form.lname#&lt;/cfoutput&gt;&lt;/font&gt;&lt;/th&gt;&lt;/tr&gt;<br>&nbsp;&nbsp;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Action&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Record Number&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Equip&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Title&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Status&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Appointment Date&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;<br>&nbsp;&nbsp;&lt;!--- Output table record(s) section ---&gt;<br>&nbsp;&nbsp;&lt;CFOUTPUT QUERY=&quot;jobs&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;&lt;td&gt;&lt;a href=&quot;nopost.cfm?posting=#NumberFormat(postingno, '999')#&quot;&gt;Delete&lt;/a&gt;&lt;/td&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;#NumberFormat(postingno, '999')#&lt;/td&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;#equip#&lt;/td&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;#title#&lt;/td&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;#status#&lt;/td&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;#DateFormat(appdate, 'mm/dd/yyyy')#&lt;/td&gt;<br>&nbsp;&nbsp;&lt;/CFOUTPUT&gt;<br>&nbsp;&nbsp;&lt;/table&gt;<br>&nbsp;&nbsp;&lt;p&gt;<br>Click the &lt;font color=blue&gt;DELETE&lt;/font&gt; beside the record you want removed!<br>&lt;/CFIF&gt;<br><br>Here is the 'nopost.cfm' code:<br><br>&lt;CFIF ParameterExists(url.posting)&gt;<br>&nbsp;&nbsp;&lt;CFQUERY NAME=&quot;deljob&quot; DATASOURCE=&quot;PW_Personnel&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;DELETE&nbsp;&nbsp;FROM EQUIPMEN<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WHERE postingno = #url.posting#<br>&nbsp;&nbsp;&lt;/CFQUERY&gt;<br>&lt;/cfif&gt;<br>&lt;cflocation url=&quot;getjobs.cfm&quot;&gt;<br><br>&lt;!--- response to client ---&gt;<br>&lt;HTML&gt;<br>.....additional output ...<br><br>The table is a dBase table and the postingno field is a real number type. I have also tried this as a form submission instead of passing the url parameter with the same results. Any response would be much appreciated.<br>Thanx,<br>koopmaun<br>
 
May be you are keeping the Database table open when u are deleting records from the form. If that is the case close the database. and it should work. If u have any problem lemme know.<br>Praveen
 
I'm not familiar with dBase, but you may want to make sure that the CF application has delete permission for that table...
 
Thanks for the suggestions. Neither worked so I created an Access database with the tables needed and it worked with no problems. Still puzzles me why the dBase tables wouldn't work as I have had no problem adding a record to them. Oh well, skinned the cat another way I guess. <br><br>Thanks again for the replies.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top