ASP ADO & MS Access

The following error has started to appear in on an ASP page.

ADODB.Recordset error '800a0bb9'

The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another.

/y2K/MailPut.asp, line 16

The following code causes this error: -

sSQL = "SELECT * FROM MailTo"
      
Set dbY2K = Server.CreateObject ("ADODB.Connection")
dbY2K.Open "Y2K", "", ""
      
Set rsY2K = Server.CreateObject ("ADODB.Recordset")
rsY2K.Open sSQL, dbY2K, adOpenDynamic, adLockOptimistic
(the line above is line 16)

rsY2K.AddNew
rsY2K ("Name") = Request.Form ("textfield") & " "
rsY2K ("Dept") = Request.Form ("textfield2") & " "
rsY2K ("Telephone") = Request.Form ("textfield3") & " " 
rsY2K ("Message") = Request.Form ("textfield4") & " "
rsY2K.Update

Does anyone have any ideas about how to get this working?

Thanks
knghAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TTomCommented:
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
manojaminCommented:
have you tried using,

adOpenKeyset

rather than

adOpenDynamic

0
mgfranzCommented:
Where is the dB file located?  Is it in the same directory as the .asp file?

Mark
0
Become a CompTIA Certified Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

clockwatcherCommented:
I'd guess that you don't have the constants (adOpenDynamic, adLockOptimistic) defined anywhere.

Do you have a type library defined in your global.asa?  Or are you including adovbs.inc anywhere within the current asp page?

If not you'll need to explicitly define your constants before you use them.

const adOpenKeyset = 1
const adLockOptimistic = 3

0
mgfranzCommented:
As Clock mentioned, you can re-write the line 16 as such;

rsY2K.Open sSQL, dbY2K, 1, 3

Mark
0
knghAuthor Commented:
Thanks
0
clockwatcherCommented:
Just out of curiousity was that really the comment that lead to your solution?  

Your global.asa file wasn't firing, because it wasn't at an application root-- and you have a type library declared in it.

Or was it simply because you didn't have your constants defined anywhere?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.