Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 Script Library
 error '80020009'

Author  Topic 

hizakemi
Starting Member

33 Posts

Posted - 2006-12-22 : 12:02:19
Please, help!

I'm getting error '80020009' when I retrieve data from sql table. The error occurs only if the record(s) is not on the table. How do I fix it- Please, see part of my asp script
Thk


set conn=server.createobject("ADODB.Connection")

with conn
.connectionstring=Session("strConn")
.connectiontimeout=600
.cursorlocation= adUseClient
.open
end with

set cmd=server.createobject("adodb.command")

with cmd
.activeconnection=conn
.commandtype=adCmdText
.commandtext="SELECT *, [current balance]+[MST_ACCR_INT_CTD] AS checkamount, CONVERT (NVARCHAR(10), T.[Check Issue Date], 1) AS CheckIssueDate FROM CLOSURE.DBO.[NAS] T WHERE " & strCriteria & " ORDER BY CAST(CONVERT(NVARCHAR(10), T.[DATE],101) AS DATETIME)"

end with

set rst=server.createobject("ADODB.Recordset")

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-12-22 : 12:07:31
Have you seen this link:

[url]http://classicasp.aspfaq.com/general/why-do-i-get-80020009-errors.html[/url]

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-12-22 : 23:18:58
1
Also this forum is to post workable scripts and not to ask questions
You should post your questions at Relevent Forum

2 You are using convert function on dates when you query from front end. Dont convert it, after retreiving data, convert it to the specific format using Format function

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2006-12-23 : 21:13:48
3. you are issuing adhoc sql queries from app code - a no-no.

4. your query is using "select *" which is fragile and error prone. if someone adds a column to the table, your app will break.


www.elsasoft.org
Go to Top of Page
   

- Advertisement -