Simple ASP Issue

I am developing an application on a Chilisoft ASP Enabled web server and am trying to execute a seeminlyu simple peice of code and getting failures every time.

Here is the code....

      Set dboc =Server.CreateObject("ADODB.Command")
      dboc = "Driver={MySQL ODBC 3.51 Driver};Server=localhost;Database=somedb;UId=123;Password=xyz;option=16386;"

      sql="INSERT INTO comments(name)"
      sql = sql & " VALUES ('" & request.form("name") & "')"
      dboc.Execute(sql)

It fails on the final line each time saying

800a01a8 | Object_required:_'dboc' 80


Any help would be great!  Thanks!
LVL 1
HunTelWebProgrammerAsked:
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.

John_LennonCommented:
try changing this
Set dboc =Server.CreateObject("ADODB.Command")

to this
Set dboc =Server.CreateObject("ADODB.Connection")
0
HunTelWebProgrammerAuthor Commented:
Still the same error....
/includes/add_comment.asp |8|800a01a8|Object_required:_'dboc' 80
0
John_LennonCommented:
sorry, try this
'################
set dboc = server.createObject("ADODB.Connection")
dboc.mode = 3
dboc.open "Driver={MySQL ODBC 3.51 Driver};Server=localhost;Database=somedb;UId=123;Password=xyz;option=16386;"

sql="INSERT INTO comments(name)"

sql = sql & " VALUES ('" & request.form("name") & "')"

dboc.Execute(sql)
'#####################3
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
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

walkerkeCommented:
On line 2 you have: dboc = "Driver={MySQL OD...

Shouldn't it be: dboc.ConnectionString = "Driver={MySQL OD...  ?
0
HunTelWebProgrammerAuthor Commented:
John_Lennon

Thank goodness that worked.  I have been using that peice of code for nearly 3 years with sucess all the time on IIS.  Is this something that is specific to Chilisoft ASP?  Could you please describe the what you reccomeneded so I know for future refrence.  

Thanks loads!  I have been fighting this for a coupel days!
0
John_LennonCommented:
glad to help

################
set dboc = server.createObject("ADODB.Connection") '--> You create the object as an ADODB Connection

dboc.mode = 3 '---> 3 means permission to read, write, you also can use 1 for read-only and 2 for write-only

dboc.open "Driver={MySQL ODBC 3.51 Driver};Server=localhost;Database=somedb;UId=123;Password=xyz;option=16386;" '---> You open the connection using your connection string

sql="INSERT INTO comments(name)"
sql = sql & " VALUES ('" & request.form("name") & "')"

dboc.Execute(sql) '---> execute the query (sql) with the connection (dboc)
'#####################

actualy, i have never use
Set dboc =Server.CreateObject("ADODB.Command")
so i don't know how this work, i always use
set dboc = server.createObject("ADODB.Connection")
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.