I have a stroed procedure in an Access 2000 project file as such:
SELECT TNo, AssignedTo, ResolutionInform, SignOffDate
FROM tblMain
WHERE (DATALENGTH(Resolution) < 150) AND (Aborted = 0) AND
(ResolutionInform = 0) AND (NOT (SignOffDate IS NULL))
When I access this through ADO and try to update the ResolutionInform boolean value I get the following message :
"The query is not updateable because the from clause is not a single simple table name"
This message is generally associated with a query that has more than one table. As you can see, my SP only has one table "tblMain". The ADO code that fails is below :
Dim cnn As New ADODB.Connection
Dim rstSignOffNullCount As New ADODB.Recordset
cnn.ConnectionString = "driver={SQL Server};server=sqltemp;uid=###;pwd=####;database=Helpdesk"
cnn.ConnectionTimeout = 30
cnn.Open
rstMainResInform.CursorType = adOpenKeyset
rstMainResInform.LockType = adLockOptimistic
rstMainResInform.Open "hdsp_MainResInform", cnn, , , adCmdStoredProc
rstMainResInform.MoveFirst
Do Until rstMainResInform.EOF
rstMainResInform("resolutioninform"
= 1
rstMainResInform.Update
rstMainResInform.MoveNext
Loop
rstMainResInform.Close
cnn.Close
Set cnn = Nothing
There obviously is a bit more code within the loop that I have not included due to irrelevence.
Thanks for any advice
Notch. X-) [sig][/sig]
SELECT TNo, AssignedTo, ResolutionInform, SignOffDate
FROM tblMain
WHERE (DATALENGTH(Resolution) < 150) AND (Aborted = 0) AND
(ResolutionInform = 0) AND (NOT (SignOffDate IS NULL))
When I access this through ADO and try to update the ResolutionInform boolean value I get the following message :
"The query is not updateable because the from clause is not a single simple table name"
This message is generally associated with a query that has more than one table. As you can see, my SP only has one table "tblMain". The ADO code that fails is below :
Dim cnn As New ADODB.Connection
Dim rstSignOffNullCount As New ADODB.Recordset
cnn.ConnectionString = "driver={SQL Server};server=sqltemp;uid=###;pwd=####;database=Helpdesk"
cnn.ConnectionTimeout = 30
cnn.Open
rstMainResInform.CursorType = adOpenKeyset
rstMainResInform.LockType = adLockOptimistic
rstMainResInform.Open "hdsp_MainResInform", cnn, , , adCmdStoredProc
rstMainResInform.MoveFirst
Do Until rstMainResInform.EOF
rstMainResInform("resolutioninform"
rstMainResInform.Update
rstMainResInform.MoveNext
Loop
rstMainResInform.Close
cnn.Close
Set cnn = Nothing
There obviously is a bit more code within the loop that I have not included due to irrelevence.
Thanks for any advice
Notch. X-) [sig][/sig]