Microsoft VBScript runtime error '800a01a8' Object required: ''
Hi,
I'm really struggling to display the following:
<%response.Write(rsGetEFACsIAdd.Fields.Item("contactid").value)%>
The error Object required: '' is shown when running the code?
I'm running the code from this function:
Function FGetEFACsAddress1(paddrcode, paddritem)
Dim rsGetEFACsIAdd
Dim rsGetEFACsIAdd_numRows
Set rsGetEFACsIAdd = Server.CreateObject("ADODB.Recordset")
rsGetEFACsIAdd.ActiveConnection = MM_conn_to_EFACs_STRING_ap
rsGetEFACsIAdd.Source = "SELECT traderid, street, city, postcode FROM [efacdb].[dbo].[tradersaddresses] WHERE traderid = '" & paddrcode & "' AND addressid = '"& paddritem & "'"
rsGetEFACsIAdd.CursorType = 0
rsGetEFACsIAdd.CursorLocation = 2
rsGetEFACsIAdd.LockType = 1
rsGetEFACsIAdd.Open()
rsGetEFACsIAdd_numRows = 0
if NOT rsGetEFACsIAdd.EOF then
ReturnVal = Trim(rsGetEFACsIAdd.Fields.Item("street").Value)
else
ReturnVal = "0"
end if
rsGetEFACsIAdd.Close()
Set rsGetEFACsIAdd = Nothing
FGetEFACsAddress1 = ReturnVal
End Function
The if not statement is returning true so I'm not sure where it is falling over?
Thanks for the support
I attempted the same thing, modifying the values to match items in my own database, and had no issues.
What value types are paddrcode & paddritem? If they are numerical, in a numerically-defined field these should not have the apostrophes (') surrounding them. Also, I'm guessing the database/table structure ([efacdb].[dbo].[tradersaddresses]) works for other data for you, as this is something I obviously cannot test.
What line number does the error point to?
Getting same VBScript runtime error
Microsoft VBScript runtime error '800a01a8'
Object required: ''
/contact.asp, line 3
HERE ARE LINES 1- 3 OF CODE
1 <!-- #include file="config/header.asp" -->
2 <%
3 Set oRS = db_conn.Execute("SELECT * FROM cs_Contact WHERE ID=1")
I HAVE NO IDEA WHAT'S GOING ON. I DO USE ASP/CASCADE FOR UPDATING PAGE AS WELL AS DREAMWEAVER FOR CERTAIN ELEMENTS.
PLEASE HELP!
Where are you defining db_conn?
All Sorted my end, trying to use an incorrect value against the database!
Originally Posted by
mgalaxy
1 <!-- #include file="config/header.asp" -->
2 <%
3 Set oRS = db_conn.Execute("SELECT * FROM cs_Contact WHERE ID=1")
can you post code from your header.asp file?
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Bookmarks