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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADO 2.1 Error - No value given for one or more required parameters

Status
Not open for further replies.

culshaja

Programmer
Aug 10, 1999
705
GB
Getting 'No value given for one or more required parameters' as an error from both a connection object and a command object whene issuing a delete statement.<br>
Code looks as follows:<br>
<br>
strDeleteSQL = &quot;DELETE * FROM y WHERE (((ws_id) = &quot; & CStr(lngWSID)<br>
strDeleteSQL = strDeleteSQL & &quot;) AND ((day_id) = &quot; & CStr(Day) & &quot;));&quot;<br>
<br>
with then either:<br>
<br>
acnWS.Execute strDeleteSQL, lngRecordsAffected, adCmdText Or adExecuteNoRecords<br>
<br>
Or <br>
<br>
Set acmDelete = New ADODB.Command<br>
acmDelete.CommandText = strDeleteSQL<br>
acmDelete.CommandType = adCmdText<br>
Set acmDelete.ActiveConnection = acnWS<br>
acmDelete.Execute<br>
<br>
Can someone enlighten me to what is going wrong.<br>
<br>
James :) <p>James Culshaw<br><a href=mailto:james_culshaw@activedatasolutions.madasafish.com>james_culshaw@activedatasolutions.madasafish.com</a><br><a href= > </a><br>
 
Delete * from ..... is improper syntax.<br>
You must say: Delete from.... <br>
The * is redundant.<br>
<br>
ADO is a work in progress. That is a polite way of saying that it is half-baked. In particular the error reporting is at best misleading and at worst a bad joke. Try putting eleven characters in a ten character column. You get the infamous &quot;Errors Occurred&quot;. I have found that the best way to cope with ADO development is to have a copy of SQL Server Query Analyzer running. Cut and paste the SQL statement into the Analyzer and run it there. You may indeed get the SQL equivalent of &quot;errors occurred&quot; :&quot;Error near xxx&quot;, but at least it wont be misleading. <p>Roy Lofquist<br><a href=mailto:roylofquist@msn.com>roylofquist@msn.com</a><br><a href= > </a><br>
 
If the data source for a form created by the Data Form Wizard contains a dash '-' in its name or in the name of a field, it is required that the data source name or field name be delimited by brackets in a SQL statement. The Data Form Wizard does not include brackets around these names. <br>
<br>
<br>
To work around this problem, modify the code created by the Data Form Wizard by placing brackets around references to any data sources or field names that contain the '-' character. <br>
<br>
Alternatively, data sources and their fields could be renamed to eliminate '-' characters. This solution could involve more work in general, but may be acceptable at the beginning stages of application development. <br>
<br>
<br>
Eric<br>
<p>Eric De Decker<br><a href=mailto:vbg.be@vbgroup.nl>vbg.be@vbgroup.nl</a><br><a href= Visual Basic Center</a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top