Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lost in space!

Status
Not open for further replies.

DotNetBlocks

Programmer
Apr 29, 2004
161
US
hello,
I need some help! i have double checked the permissions and, I keep getting this error message.

Microsoft VBScript runtime error '800a01b6'

Object doesn't support this property or method: 'rs.Edit'

/companyLeads.asp, line 50

Source Code:
<SCRIPT LANGUAGE=vbscript RUNAT=Server>
Function CompanyLeads(LeadID, CompanyID, LeadPrice)
'On Error Resume Next


Set cn = Server.CreateObject(&quot;ADODB.Connection&quot;)
Set rs = Server.CreateObject(&quot;ADODB.Recordset&quot;)
cn.Open &quot;DSN=Alloptions;&quot;
Set rs.ActiveConnection = cn


sql1 = &quot;Select * from CompanyLeads Where CompanyLeadID=1&quot;
rs.Source = sql1
rs.CursorLocation = 3
rs.LockType = 3
rs.Open

rs.AddNew
rs.fields(&quot;LeadID&quot;) = LeadID
rs.fields(&quot;Date&quot;) = Date
rs.fields(&quot;Time&quot;) = Time
rs.fields(&quot;CompanyID&quot;) = CompanyID
rs.fields(&quot;Price&quot;) = LeadPrice

rs.Update
rs.Close
cn.Close

Set cn = Nothing
Set rs = Nothing

End Function

Function SubCap(CompanyID, LeadPrice)
'On Error Resume Next


Set cn = Server.CreateObject(&quot;ADODB.Connection&quot;)
Set rs = Server.CreateObject(&quot;ADODB.Recordset&quot;)
cn.Open &quot;DSN=Alloptions;&quot;
Set rs.ActiveConnection = cn


sql1 = &quot;SELECT * FROM Companies WHERE (CompanyID = '&quot; & CompanyID & &quot;')&quot;
rs.Source = sql1
rs.CursorLocation = 3
rs.LockType = 3
rs.Open

rs.Edit

rs.fields(&quot;LeadsCap&quot;) = CLng(rs.fields(&quot;LeadsCap&quot;)) - CLng(LeadPrice)

rs.Update
rs.Close
cn.Close

Set cn = Nothing
Set rs = Nothing

End Function

Function LastLead(CompanyID, LeadID)
'On Error Resume Next


Set cn = Server.CreateObject(&quot;ADODB.Connection&quot;)
Set rs = Server.CreateObject(&quot;ADODB.Recordset&quot;)
cn.Open &quot;DSN=Alloptions;&quot;
Set rs.ActiveConnection = cn

sql1 = &quot;SELECT * FROM CompanySelect WHERE (CompanyID = '&quot; & CompanyID & &quot;')&quot;


rs.Source = sql1
rs.CursorLocation = 3
rs.LockType = 3
rs.Open

rs.Edit

rs.fields(&quot;LastLead&quot;) = LeadID

rs.Update

rs.Close
cn.Close

Set cn = Nothing
Set rs = Nothing

End Function

</SCRIPT>

Any help would be appreciated.

Babloome

 
Babloome,

When you do execute these two lines, you are already editing the record.


rs.fields(&quot;LeadsCap&quot;) = CLng(rs.fields(&quot;LeadsCap&quot;)) - CLng(LeadPrice)
rs.Update

Comment out the line &quot;rs.edit&quot;, it is not supported.


fengshui_1998
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top