Hi all,
I need to update records in an excel spreadsheet, I'm reading the spreadhseet content using:
This works fine, I then try to update soe of the excel data using:
But i'm getting the error 'must use updateable query'. Any suggestions?
Cheers in advance
I need to update records in an excel spreadsheet, I'm reading the spreadhseet content using:
Code:
csvcon="Driver={Microsoft Excel Driver (*.xls)};DriverId=790;Dbq=" & Server.mappath("\mypath\db\import.xls") & ";"
Dim SQL
SQL="SELECT [reportMAP$].ReportNum, [reportMAP$].RecNum, [reportMAP$].ParaRef, [reportMAP$].Recommendation, [reportMAP$].Priority, [reportMAP$].Manager, [reportMAP$].AgreedAction, [reportMAP$].DueDate, [addressbook$].Position, [addressbook$].Client FROM [AddressBook$] INNER JOIN [ReportMAP$] ON [addressbook$].CodeID = [reportMAP$].Manager GROUP BY [reportMAP$].ReportNum, [reportMAP$].RecNum, [reportMAP$].ParaRef, [reportMAP$].Recommendation, [reportMAP$].Priority, [reportMAP$].Manager, [reportMAP$].AgreedAction, [reportMAP$].DueDate, [addressbook$].Position, [addressbook$].Client HAVING ReportNum='" & Request("R") & "' ORDER BY RecNum"
set lg = Server.CreateObject("ADODB.Recordset")'
lg.ActiveConnection = csvcon
lg.Source = SQL
lg.CursorType = 2
lg.CursorLocation = 2
lg.LockType =3
lg.Open()
lg_numRows = 0
This works fine, I then try to update soe of the excel data using:
Code:
Set MM_editCmd = Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = csvcon
MM_editCmd.CommandText = "UPDATE [AddressBook$] SET CodeID=" & lgc.fields.item("CodeID").value & " Where CodeID=" & lg.fields.item("Manager").value
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
But i'm getting the error 'must use updateable query'. Any suggestions?
Cheers in advance