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

SQL problem

Status
Not open for further replies.

elziko

Programmer
Nov 7, 2000
486
GB
I'm trying to edit a field in a record using SQL. I do this:

adoRecordset.Open "SELECT * FROM [" & StorageTable & "] WHERE '" & IndexField & "'='" & ConnectedField.Text & "'", adoConnection, adOpenKeyset, adLockOptimistic, adCmdText

adoRecordset!StorageField = File.Text '**

adoRecordset.Update


But I get a runtime error when we get to the line with '** next to it:

"ADO could not find the object in the collection corresponing to the name or ordinal reference requested by the application."

I cant work out what this error message is going on about. I debug.print the SQL string which gives this:

SELECT * FROM [Inspection 1] WHERE 'Road Name'='CLEVELAND STREET' which seems to contain the correct table, field, and record so I sume it must be something to do woth the other parameters?

Any help,

thanks

elziko
 
you need to encase your field name in square brackets

eg "select * from [Table Name] where [field name]='String'"

hope this helps

Thanks
Carl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top