Problems updating a record

Results 1 to 2 of 2

Thread: Problems updating a record

  1. #1
    Wexie Guest

    Default Problems updating a record

    I am trying to update a record. I am using an SQL statement to find the record and then open only that record, but I think either the SQL or the connection line is wrong... I am sure that I can&#039t use adCmdTable when I dont have a table... But how do I fix it?<BR><BR>strSQL = "SELECT ProjServices.*, ProjServices.CentreID, ProjServices.ProjectID " & _<BR>"FROM ProjServices WHERE ProjServices.CentreID= " & intCentreID & " AND ProjServices.ProjectID = " & intProjID & ""<BR><BR>...<BR><BR>objRec.Open strSQL, objConn, , adLockOptimistic, adCmdTable<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Problems updating a record

    I think you want something like this...<BR><BR>strSQL = "SELECT * FROM ProjServices WHERE CentreID = " & intCentreID & " AND ProjectID = " & intProjID<BR><BR>...<BR><BR>objRec.Open strSQL, objConn, , adLockOptimistic, adCmdText<BR><BR>Be alerted that this will give you a forward-only recordset; if you need backward scrolling, insert adOpenStatic for the argument you skipped in the open statement. I&#039m also assuming that both of your criteria fields are numeric since the values start with int.<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts