sql - ASP Object required: 'Server -
i try handle http , insert data in oledb database using asp web application on visual studio 2012. create html item , change extention html asp.
this code:
<% 'declare variables dim connection dim recordset dim sql dim objrs dim objconn dim strconnect 'option explicit dim nome, id nome = request.querystring("name") id = request.querystring("id") 'declare sql statemant query db sql = "insert tablename (nomefilenotifica, iderrore, isnew) values ('"+nome+"', "+ id +", 1)" strconnect = "provider=microsoft.jet.oledb.4.0; data source = ***; database = dbname; user id = username; password=password;" set objconn = server.createobject(adodb.connection) objconn.open "tablename" , strconnect set objrs = server.createobject(adodb.recordset) objrs.open sql, objconn, 0 ,1 ' .. more processing of other variables .. ' 'processing / validation done... ' response.write nome & vbcrlf response.write id & vbcrlf %>
the handler works if try connect database have error below
object required: 'server
at line:
set objconn = server.createobject(adodb.connection)
all asp script inside body of html page.. don't find solution in internet , haven't many experience in asp. can me? thank you
i found error.
i forgot quotes around adodb.connection
set objconn = server.createobject("adodb.connection")
Comments
Post a Comment