HunTelWebProgrammer
asked on
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("ADOD B.Command" )
dboc = "Driver={MySQL ODBC 3.51 Driver};Server=localhost;D atabase=so medb;UId=1 23;Passwor d=xyz;opti on=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!
Here is the code....
Set dboc =Server.CreateObject("ADOD
dboc = "Driver={MySQL ODBC 3.51 Driver};Server=localhost;D
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!
ASKER
Still the same error....
/includes/add_comment.asp |8|800a01a8|Object_require d:_'dboc' 80
/includes/add_comment.asp |8|800a01a8|Object_require
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
On line 2 you have: dboc = "Driver={MySQL OD...
Shouldn't it be: dboc.ConnectionString = "Driver={MySQL OD... ?
Shouldn't it be: dboc.ConnectionString = "Driver={MySQL OD... ?
ASKER
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!
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!
glad to help
################
set dboc = server.createObject("ADODB .Connectio n") '--> 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;D atabase=so medb;UId=1 23;Passwor d=xyz;opti on=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("ADOD B.Command" )
so i don't know how this work, i always use
set dboc = server.createObject("ADODB .Connectio n")
################
set dboc = server.createObject("ADODB
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;D
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("ADOD
so i don't know how this work, i always use
set dboc = server.createObject("ADODB
Set dboc =Server.CreateObject("ADOD
to this
Set dboc =Server.CreateObject("ADOD