I'm sure I've answered this about 3 times now. You are creating an ADO connection object called "cn". You're then assigning a connection string value directly to the "cn" variable instead of using the connection string to open the DB connection, so when you try to use the Execute method of the "cn" connection object it's no longer a connection object, but a string type variable holding your connection string. You need to assign the connection string to a *separate* variable and then pass that variable as a parameter to the Open() method of the connection object. dim cn dim strConnString Set cn = Server.CreateObject("ADODB.Connection") strConnString = "DRIVER={Microsoft Access Driver (*.mdb)}; " strConnString = strConnString & "DBQ=" & Server.MapPath("/access_db/wecommerce.mdb") cn.Open strConnString '... Sql = "update postpro set bids=" & hit & " where projectname='" & a & "'" cn.Execute sql cn.close
Dan ________________________________ From: AspClassicAnyQuestionIsOk@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jegatha Sent: 26 August 2005 09:33 To: Asp Subject: [AspClassicAnyQuestionIsOk] Update error hi my code is, a=session("projectnamebrowse") set cn=server.createobject("ADODB.connection") set rs=server.createobject("ADODB.recordset") set rs1=server.createobject("ADODB.recordset") set rs2=server.createobject("ADODB.recordset") cn="DRIVER={Microsoft Access Driver (*.mdb)}; " cn=cn & "DBQ=" & Server.MapPath("/access_db/wecommerce.mdb") rs.open "select * from projectsubmit",cn,1,2 while not rs.eof if(rs("ProjectName")=a) then hit=rs("hits")+1 else hit=0 end if rs.movenext wend response.write hit response.write a sql="update postpro set bids="&hit&" where projectname='"&a&"' " cn.Execute sql i got the following error, Microsoft VBScript runtime error '800a01a8' Object required: 'DRIVER={Microsoft Ac' /wecommerce/submit2.asp, line 44 always fighting with update code, can anyone help me with the proper code? thanks in adv regards, Jegatha --------------------------------- Check out Yahoo! India Rakhi Special for Rakhi shopping, contests and lots more. http://in.promos.yahoo.com/rakhi/index.html [Non-text portions of this message have been removed] ________________________________ YAHOO! GROUPS LINKS * Visit your group "AspClassicAnyQuestionIsOk <http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk> " on the web. * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED] subscribe> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service <http://docs.yahoo.com/info/terms/> . ________________________________ ------------------------ Yahoo! Groups Sponsor --------------------~--> Fair play? Video games influencing politics. Click and talk back! http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/saFolB/TM --------------------------------------------------------------------~-> Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/