ADO Update Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am having an issue of updating a record that has been extracted out of a
text file. I am using the ADO Addnew and Update methods. My code:

If CN.State = adStateClosed Then
CN.Open "DSN=Traffic_Data;UID=traf_data1;PWD=traf_data1;"
End If

If Not RsPort Is Nothing Then
If (RsPort.State And adStateOpen) = adStateOpen Then
RsPort.Close
Else
Set RsPort = New ADODB.Recordset
End If
End If

RsPort.CursorType = adOpenKeyset
RsPort.LockType = adLockOptimistic
RsPort.Open "TRAF_DATA1.TBL_PORTABLE_CLASS_TEMP", CN, , , adCmdTable
RsPort.AddNew
RsPort!MilePoint = sMP
RsPort!Direction = sDirection
RsPort!CollectionMethod = sCountMethod
RsPort.Update

Everything is fine until the code RsPort.Update executes. I get the Oracle
error Table or View does not exist. The tables are linked in Access BTW. Even
though
RsPort.State reports 1 - it is open. The correct permissions are set in the
Oracle side so I don't think it's that. Any ideas?
 
If the tables are already linked, then you do not need the connection object
you are using. You can just use CurrentProject.Connection in place of the CN
in the RsPort.Open code. I have a feeling that is causing your problem.
--
Bob Larson
Access World Forums Super Moderator
Utter Access VIP
Tutorials at http://www.btabdevelopment.com
__________________________________
If my post was helpful to you, please rate the post.
 
Back
Top