Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > SQL Language
|
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 21st, 2005, 06:28 PM
Authorized User
 
Join Date: Dec 2003
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to bsausser
Default DELETE FROM returns error: Too many fields defined

Dev: Visual Studio – ASP.NET – C#

using System.Data.Odbc

ConnectionString = “DBQ=<file location>;Driver={Microsoft dBase Driver (*.dbf)};”

This works:
SQL: “SELECT UNIQUE_ID, NAME, USR1128 FROM wfhm.dbf”

This returns an error:
SQL: “DELETE FROM wfhm.dbf WHERE UNIQUE_ID = ‘xxxxxx’”

Error message says: “Too many fields defined”

*I understand that there is a 255 limit on fields, however I’m trying to delete a record, and get the same error.

**I even tried linking tables in access 2000 and then using OleDb; same error

Anyone?


Brian Sausser, MCP
(858) 229-6129
__________________
Brian Sausser, MCP
(858) 229-6129
 
Old November 22nd, 2005, 09:56 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi there..

did you try: SQL: “DELETE * FROM wfhm.dbf WHERE UNIQUE_ID = ‘xxxxxx’”??


HTH

Gonzalo
 
Old November 22nd, 2005, 12:36 PM
Registered User
 
Join Date: Nov 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to gtaylor
Default

sorry I did'nt see the subsequent post. what is the content of the dbf? your delete from statement should work in a one-to-one scenario.
 
Old November 22nd, 2005, 02:25 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Another idea.. maybe the delete do something that return more than 255 fields?? I found some things about that after a google search...

can you do the delete if you select the fields by hand???

HTH

Gonzalo
 
Old November 22nd, 2005, 06:19 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

;;;can you do the delete if you select the fields by hand???
no

sql = "DELETE FROM tbleName WHERE ID=" & request.form("id") & ";"


FYI dont forget trailing semi colons

Wind is your friend
Matt
 
Old November 23rd, 2005, 03:32 PM
Authorized User
 
Join Date: Dec 2003
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to bsausser
Default

Thanks for all the ideas, however they did not work.

I did try every suggestion on the sql statement itself to no avail, and even tried changing the Command Execute Type:

cmdSel.ExecuteNonQuery();
cmdSel.ExecuteScalar();
cmdSel.ExecuteReader();

each return the same error: too many fields defined.

Any other ideas?
Brian

Brian Sausser, MCP
(858) 229-6129
 
Old November 23rd, 2005, 04:18 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

AFAIK, .dbf files are read-only as of version 2.1 of MDAC when you use the dBase Driver. It wouldn't surprise me if the error you get is due to this driver issue.

Either get a third-party driver or use the FoxPro driver, as explained in this article: http://support.microsoft.com/kb/q238431/

HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to delete file System.IO.Delete error maricar C# 13 March 14th, 2014 06:50 AM
Appl-defined or Object-defined error 1004 chp Excel VBA 3 April 4th, 2006 08:12 AM
SQL Query returns error Raphasevilla Access VBA 2 February 22nd, 2006 08:30 AM
BookApp returns error serpentierr JSP Basics 1 September 5th, 2003 10:11 PM
Application-defined or object-defined error James Excel VBA 1 August 12th, 2003 11:50 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.