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

Left() error

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
ADODB.Fields error '800a0cc1'

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

/temp/error.asp, line 15

This is the error I get when I enter the following code.
sql_cmd = "SELECT ReceivedAt, Facility, Priority, FromHost, left(Message,4) from systemevents where ReceivedAt BETWEEN { d'" & FormatStdDate(MyDateBegin) & "' } AND { d'" & FormatStdDate(MyDateEnd2) & "'} order by ReceivedAt desc"

I am getting the error because I want to select the first 4 characters of my message field. Please help me with the proper syntax. I am using VB script.

 
Hey Troy,

I just tried a similar query on an Access DB and it worked but I had to give the field an alias. like this:

sql_cmd = "SELECT ReceivedAt, Facility, Priority, FromHost, left(Message,4) AS ClipMessage from systemevents where ReceivedAt BETWEEN { d'" & FormatStdDate(MyDateBegin) & "' } AND { d'" & FormatStdDate(MyDateEnd2) & "'} order by ReceivedAt desc"

Otherwise I think the DB tries to assign it a different name and that is probably where the name error was comming up.

If that isn't it give us more info. What DB is it? Does the error line coincide with the db call or with the use of the field? All that good stuff.

Hope it helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top