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

adCmdText + adExecuteNoRecords Causes Error

Status
Not open for further replies.

RichardF

Programmer
Oct 9, 2000
239
GB
Hi,

This is an extract from the MSDN library :

'The adExecuteNoRecords constant improves performance by minimizing internal processing. This constant never stands alone; it is always combined with adCmdText or adCmdStoredProc (for example, adCmdText+adExecuteNoRecords).'

but when I do this :

Private cnOLE As New ADODB.Connection
Private cmOLE As New ADODB.Command

cnOLE.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source = " & cSource
cnOLE.Open
Set cmOLE.ActiveConnection = cnOLE
cmOLE.CommandType = adCmdText + adExecuteNoRecords

I get the following error message :

Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

Any ideas ?
 
Hi there,

This adExecuteNoRecords optimizes performance! It does not fetch back any records. I use it with bulk transactions over a connection object [ e.g. Cnn_Adm] and an sql statement [e.g. sqlString] to be executed, and looks like this:

Code:
Cnn_Adm.Execute sqlString, adCmdText, adExecuteNoRecords
[\code]

so give it a try like this

[code]
cmOLE.Execute , , adCmdText, adExecuteNoRecords
[\code]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top