ADO error on recordset.update 
Author Message
 ADO error on recordset.update

RunTime error 2147217888(80040e20)
Provider called a method from IrowsetNotify in the consumer and the method
has not yet returned

is generated at the rst.update line in the save routine below

Any ideas would save my sanity right now!
This is my first big VB6 ADO project, thus any hints or experiences would be
great

Thanks (sorry about the amount of code here, but I am getting really
stressed with this one...)

Mike Whitaker

Private Sub mnuDataSaveAnimal_Click()
On Error GoTo mnuDataSaveAnimal_Click_Err
If rst.EditMode = adEditAdd Then
    rst("AnimalID").Value = GetNewIDString("dat-Animals", "AnimalID")
ElseIf rst.EditMode = adEditInProgress Then
    rst("AnimalID").Value = Me.TextAnimalID
End If
    rst("PersonID").Value = Me.DataComboOwner.BoundText
    rst("AnimalName").Value = Me.TextAnimal_Name
    rst("Breed").Value = Me.DataComboBreed.BoundText
    rst("Colour").Value = Me.DataComboColour.BoundText
    rst("DateOfBirth").Value = CDate(Me.TextDateOfBirth)
    rst("Status").Value = Me.DataComboStatus.BoundText
    'rst("Notes").Value = Me.TextNotes
    rst("Warning").Value = Me.TextWarning
    rst("Sex").Value = Me.DataComboSex.BoundText
    rst("Desexed").Value = CBool(Me.Checkdesexed)
    rst("DesexedDate").Value = CDate(Me.TextDateDesexed)
    rst("LastModified").Value = Now()
    rst.Update

SetReadOnly

Exit Sub
mnuDataSaveAnimal_Click_Err:

Select Case Err.Number
Case 3260 'record locked by another user
    MsgBox "The record that you are trying to update is locked by another
user, please try again later.", vbCritical, AppName
Case Else
    MsgBox Err.Number & " " & Err.Description
End Select
On Error Resume Next

rst.CancelUpdate
SetReadOnly
End Sub

Other routines are

Private Sub mnuDataNewAnimal_Click()
On Error GoTo mnuDataNewAnimal_Click_Err

SetEditMode
'ClearCells
rst.AddNew

end Sub

Private Sub Form_Load()
On Error GoTo Form_Load_Err

Dim RstStatusString As String
Dim RstColourString As String
Dim RstBreedString As String
Dim RstOwnerString As String
Dim RstSexString As String

Dim x As New ADODB.Command

showWorking "Setting up form colours"

Me.BackColor = RGB(rgbRedSub, rgbGreenSub, rgbBlueSub)
Me.SSTab1.BackColor = RGB(rgbRedSub, rgbGreenSub, rgbBlueSub)

SetReadOnly
showWorking "Finding Data"
S = "SELECT [Dat-Animals].* From [Dat-Animals] ORDER BY
[Dat-Animals].[AnimalName]"
rst.Open S, PCVetCon, adOpenDynamic, adLockPessimistic, 1

RstStatusString = "SELECT [Ref-Status].* From [Ref-Status] ORDER BY
[Ref-Status].Status"
RstStatus.Open RstStatusString, PCVetCon, adOpenStatic, adLockPessimistic, 1

RstColourString = "SELECT [Ref-Animal-Colour].* From [Ref-Animal-Colour]
ORDER BY [Ref-Animal-Colour].Colour"
RstColour.Open RstColourString, PCVetCon, adOpenStatic, adLockPessimistic, 1

RstBreedString = "SELECT [Ref-Breed].Breed From [Ref-Breed] ORDER BY
[Ref-Breed].Breed"
RstBreed.Open RstBreedString, PCVetCon, adOpenStatic, adLockPessimistic, 1

RstOwnerString = "SELECT [Dat-People].PersonID, [SName] + ', ' + [Title] + '
' + [FName] AS FullName From [Dat-People] ORDER BY [Dat-People].SName"
RstOwner.Open RstOwnerString, PCVetCon, adOpenStatic, adLockPessimistic, 1

RstSexString = "SELECT [Ref-Sex].Sex From [Ref-Sex] ORDER BY [Ref-Sex].Sex"
RstSex.Open RstSexString, PCVetCon, adOpenStatic, adLockPessimistic, 1

DoEvents
showWorking "Loading Animal Data"

DoEvents

DoEvents
showWorking "Linking Data Fields"

 With Me.TextAnimalID
    Set .DataSource = rst
    .DataField = "AnimalID"
End With

With Me.TextAnimal_Name
    Set .DataSource = rst
    .DataField = "AnimalName"
End With

With Me.DataComboOwner
    Set .RowSource = RstOwner
    .ListField = "FullName"
    .BoundColumn = "PersonID"
    Set .DataSource = rst
    .DataField = "PersonID"
End With

With Me.DataComboBreed
    Set .RowSource = RstBreed
    .BoundColumn = "Breed"
    .ListField = "Breed"
    Set .DataSource = rst
    .DataField = "Breed"
End With

With Me.DataComboColour
    Set .RowSource = RstColour
    .BoundColumn = "Colour"
    .ListField = "Colour"
    Set .DataSource = rst
    .DataField = "Colour"
End With

With Me.TextNotes
    Set .DataSource = rst
    .DataField = "Notes"
End With

With Me.DataComboStatus
    Set .RowSource = RstStatus
    .BoundColumn = "Status"
    .ListField = "Status"
    Set .DataSource = rst
    .DataField = "Status"
End With

With Me.TextWarning
    Set .DataSource = rst
    .DataField = "Warning"
End With

With Me.TextDateOfBirth
    Set .DataSource = rst
    .DataField = "DateOfBirth"
End With

With Me.DataComboSex
    Set .RowSource = RstSex
    .BoundColumn = "Sex"
    .ListField = "Sex"
    Set .DataSource = rst
    .DataField = "Sex"
End With

With Me.Checkdesexed
    Set .DataSource = rst
    .DataField = "Desexed"
End With

With Me.TextDateDesexed
    Set .DataSource = rst
    .DataField = "DesexedDate"
End With

With Me.TextLastModified
    Set .DataSource = rst
    .DataField = "LastModified"
End With

HideWorking
Exit Sub
Form_Load_Err:
Select Case Err.Number
Case 1

Case Else
    MsgBox Err.Number & " " & Err.Description
    Resume Next
End Select
End Sub

The connection comes from within another routine that does..

PCVetCon.Provider = "Microsoft.Jet.OLEDB.4.0"
DoEvents
PCVetCon.Properties("Jet OLEDB:System database") = PathToWorkGroupFile
PCVetCon.Open PathToCurrentData, "veterinarian", ""
'this appear to work as planned within other forms



Sat, 01 Dec 2001 03:00:00 GMT  
 ADO error on recordset.update
Mike,

Not sure if this will help you or not, but I have also experienced problems
adding records in the 'old' style, I have been more successful with the
single line AddNew method.  Perhaps seeing if the error is occuring during
an update(edit) or an addition may help.

Regards,
Alex.


Quote:
> RunTime error 2147217888(80040e20)
> Provider called a method from IrowsetNotify in the consumer and the method
> has not yet returned

> is generated at the rst.update line in the save routine below

> Any ideas would save my sanity right now!
> This is my first big VB6 ADO project, thus any hints or experiences would
be
> great

> Thanks (sorry about the amount of code here, but I am getting really
> stressed with this one...)

> Mike Whitaker

> Private Sub mnuDataSaveAnimal_Click()
> On Error GoTo mnuDataSaveAnimal_Click_Err
> If rst.EditMode = adEditAdd Then
>     rst("AnimalID").Value = GetNewIDString("dat-Animals", "AnimalID")
> ElseIf rst.EditMode = adEditInProgress Then
>     rst("AnimalID").Value = Me.TextAnimalID
> End If
>     rst("PersonID").Value = Me.DataComboOwner.BoundText
>     rst("AnimalName").Value = Me.TextAnimal_Name
>     rst("Breed").Value = Me.DataComboBreed.BoundText
>     rst("Colour").Value = Me.DataComboColour.BoundText
>     rst("DateOfBirth").Value = CDate(Me.TextDateOfBirth)
>     rst("Status").Value = Me.DataComboStatus.BoundText
>     'rst("Notes").Value = Me.TextNotes
>     rst("Warning").Value = Me.TextWarning
>     rst("Sex").Value = Me.DataComboSex.BoundText
>     rst("Desexed").Value = CBool(Me.Checkdesexed)
>     rst("DesexedDate").Value = CDate(Me.TextDateDesexed)
>     rst("LastModified").Value = Now()
>     rst.Update

> SetReadOnly

> Exit Sub
> mnuDataSaveAnimal_Click_Err:

> Select Case Err.Number
> Case 3260 'record locked by another user
>     MsgBox "The record that you are trying to update is locked by another
> user, please try again later.", vbCritical, AppName
> Case Else
>     MsgBox Err.Number & " " & Err.Description
> End Select
> On Error Resume Next

> rst.CancelUpdate
> SetReadOnly
> End Sub

> Other routines are

> Private Sub mnuDataNewAnimal_Click()
> On Error GoTo mnuDataNewAnimal_Click_Err

> SetEditMode
> 'ClearCells
> rst.AddNew

> end Sub

> Private Sub Form_Load()
> On Error GoTo Form_Load_Err

> Dim RstStatusString As String
> Dim RstColourString As String
> Dim RstBreedString As String
> Dim RstOwnerString As String
> Dim RstSexString As String

> Dim x As New ADODB.Command

> showWorking "Setting up form colours"

> Me.BackColor = RGB(rgbRedSub, rgbGreenSub, rgbBlueSub)
> Me.SSTab1.BackColor = RGB(rgbRedSub, rgbGreenSub, rgbBlueSub)

> SetReadOnly
> showWorking "Finding Data"
> S = "SELECT [Dat-Animals].* From [Dat-Animals] ORDER BY
> [Dat-Animals].[AnimalName]"
> rst.Open S, PCVetCon, adOpenDynamic, adLockPessimistic, 1

> RstStatusString = "SELECT [Ref-Status].* From [Ref-Status] ORDER BY
> [Ref-Status].Status"
> RstStatus.Open RstStatusString, PCVetCon, adOpenStatic, adLockPessimistic,
1

> RstColourString = "SELECT [Ref-Animal-Colour].* From [Ref-Animal-Colour]
> ORDER BY [Ref-Animal-Colour].Colour"
> RstColour.Open RstColourString, PCVetCon, adOpenStatic, adLockPessimistic,
1

> RstBreedString = "SELECT [Ref-Breed].Breed From [Ref-Breed] ORDER BY
> [Ref-Breed].Breed"
> RstBreed.Open RstBreedString, PCVetCon, adOpenStatic, adLockPessimistic, 1

> RstOwnerString = "SELECT [Dat-People].PersonID, [SName] + ', ' + [Title] +
'
> ' + [FName] AS FullName From [Dat-People] ORDER BY [Dat-People].SName"
> RstOwner.Open RstOwnerString, PCVetCon, adOpenStatic, adLockPessimistic, 1

> RstSexString = "SELECT [Ref-Sex].Sex From [Ref-Sex] ORDER BY
[Ref-Sex].Sex"
> RstSex.Open RstSexString, PCVetCon, adOpenStatic, adLockPessimistic, 1

> DoEvents
> showWorking "Loading Animal Data"

> DoEvents

> DoEvents
> showWorking "Linking Data Fields"

>  With Me.TextAnimalID
>     Set .DataSource = rst
>     .DataField = "AnimalID"
> End With

> With Me.TextAnimal_Name
>     Set .DataSource = rst
>     .DataField = "AnimalName"
> End With

> With Me.DataComboOwner
>     Set .RowSource = RstOwner
>     .ListField = "FullName"
>     .BoundColumn = "PersonID"
>     Set .DataSource = rst
>     .DataField = "PersonID"
> End With

> With Me.DataComboBreed
>     Set .RowSource = RstBreed
>     .BoundColumn = "Breed"
>     .ListField = "Breed"
>     Set .DataSource = rst
>     .DataField = "Breed"
> End With

> With Me.DataComboColour
>     Set .RowSource = RstColour
>     .BoundColumn = "Colour"
>     .ListField = "Colour"
>     Set .DataSource = rst
>     .DataField = "Colour"
> End With

> With Me.TextNotes
>     Set .DataSource = rst
>     .DataField = "Notes"
> End With

> With Me.DataComboStatus
>     Set .RowSource = RstStatus
>     .BoundColumn = "Status"
>     .ListField = "Status"
>     Set .DataSource = rst
>     .DataField = "Status"
> End With

> With Me.TextWarning
>     Set .DataSource = rst
>     .DataField = "Warning"
> End With

> With Me.TextDateOfBirth
>     Set .DataSource = rst
>     .DataField = "DateOfBirth"
> End With

> With Me.DataComboSex
>     Set .RowSource = RstSex
>     .BoundColumn = "Sex"
>     .ListField = "Sex"
>     Set .DataSource = rst
>     .DataField = "Sex"
> End With

> With Me.Checkdesexed
>     Set .DataSource = rst
>     .DataField = "Desexed"
> End With

> With Me.TextDateDesexed
>     Set .DataSource = rst
>     .DataField = "DesexedDate"
> End With

> With Me.TextLastModified
>     Set .DataSource = rst
>     .DataField = "LastModified"
> End With

> HideWorking
> Exit Sub
> Form_Load_Err:
> Select Case Err.Number
> Case 1

> Case Else
>     MsgBox Err.Number & " " & Err.Description
>     Resume Next
> End Select
> End Sub

> The connection comes from within another routine that does..

> PCVetCon.Provider = "Microsoft.Jet.OLEDB.4.0"
> DoEvents
> PCVetCon.Properties("Jet OLEDB:System database") = PathToWorkGroupFile
> PCVetCon.Open PathToCurrentData, "veterinarian", ""
> 'this appear to work as planned within other forms



Mon, 03 Dec 2001 03:00:00 GMT  
 ADO error on recordset.update
Does this problem always happen, or only if you click the command
button too soon?

One solution might be to check the use of DoEvents.  Using DoEvents
makes the form re-entrant, and if the logic isn't set up to handle
this, can blow up.  In your code, it seems that the DoEvents is
included so that you can notify the user of the status.  If a query is
in the middle of populating a recordset, and the command to update the
recordset is fired, it will throw this error.

A better way to handle statuses without DoEvents is to raise an event
from a class and pass a status string to the UI.  That way, the form is
not re-entrant, all of your logic can execute without the user
cancelling it, and you can still place status messages on the form
during long-running processes.  For example:

'In the main form
Private WithEvents myObj as CMyClass

'In your class, CMyClass
Public Event UpdateStatus(strStatus As String)

'In the procedure within CMyClass that processes the recordset
RaiseEvent UpdateStatus("Beginning a long query...")
rs.Open "HugeTable", cnMyConnection

'In the main form
Private Sub myObj_UpdateStatus(strStatus as String)
    sbrMain.Panels(0).Text = strStatus
End Sub

HTH,
Kirk Allen Evans, MCP



Quote:
> RunTime error 2147217888(80040e20)
> Provider called a method from IrowsetNotify in the consumer and the
method
> has not yet returned

> is generated at the rst.update line in the save routine below

> Any ideas would save my sanity right now!
> This is my first big VB6 ADO project, thus any hints or experiences
would be
> great

> Thanks (sorry about the amount of code here, but I am getting really
> stressed with this one...)

> Mike Whitaker

> Private Sub mnuDataSaveAnimal_Click()
> On Error GoTo mnuDataSaveAnimal_Click_Err
> If rst.EditMode = adEditAdd Then
>     rst("AnimalID").Value = GetNewIDString("dat-Animals", "AnimalID")
> ElseIf rst.EditMode = adEditInProgress Then
>     rst("AnimalID").Value = Me.TextAnimalID
> End If
>     rst("PersonID").Value = Me.DataComboOwner.BoundText
>     rst("AnimalName").Value = Me.TextAnimal_Name
>     rst("Breed").Value = Me.DataComboBreed.BoundText
>     rst("Colour").Value = Me.DataComboColour.BoundText
>     rst("DateOfBirth").Value = CDate(Me.TextDateOfBirth)
>     rst("Status").Value = Me.DataComboStatus.BoundText
>     'rst("Notes").Value = Me.TextNotes
>     rst("Warning").Value = Me.TextWarning
>     rst("Sex").Value = Me.DataComboSex.BoundText
>     rst("Desexed").Value = CBool(Me.Checkdesexed)
>     rst("DesexedDate").Value = CDate(Me.TextDateDesexed)
>     rst("LastModified").Value = Now()
>     rst.Update

> SetReadOnly

> Exit Sub
> mnuDataSaveAnimal_Click_Err:

> Select Case Err.Number
> Case 3260 'record locked by another user
>     MsgBox "The record that you are trying to update is locked by
another
> user, please try again later.", vbCritical, AppName
> Case Else
>     MsgBox Err.Number & " " & Err.Description
> End Select
> On Error Resume Next

> rst.CancelUpdate
> SetReadOnly
> End Sub

> Other routines are

> Private Sub mnuDataNewAnimal_Click()
> On Error GoTo mnuDataNewAnimal_Click_Err

> SetEditMode
> 'ClearCells
> rst.AddNew

> end Sub

> Private Sub Form_Load()
> On Error GoTo Form_Load_Err

> Dim RstStatusString As String
> Dim RstColourString As String
> Dim RstBreedString As String
> Dim RstOwnerString As String
> Dim RstSexString As String

> Dim x As New ADODB.Command

> showWorking "Setting up form colours"

> Me.BackColor = RGB(rgbRedSub, rgbGreenSub, rgbBlueSub)
> Me.SSTab1.BackColor = RGB(rgbRedSub, rgbGreenSub, rgbBlueSub)

> SetReadOnly
> showWorking "Finding Data"
> S = "SELECT [Dat-Animals].* From [Dat-Animals] ORDER BY
> [Dat-Animals].[AnimalName]"
> rst.Open S, PCVetCon, adOpenDynamic, adLockPessimistic, 1

> RstStatusString = "SELECT [Ref-Status].* From [Ref-Status] ORDER BY
> [Ref-Status].Status"
> RstStatus.Open RstStatusString, PCVetCon, adOpenStatic,

adLockPessimistic, 1
Quote:

> RstColourString = "SELECT [Ref-Animal-Colour].* From [Ref-Animal-
Colour]
> ORDER BY [Ref-Animal-Colour].Colour"
> RstColour.Open RstColourString, PCVetCon, adOpenStatic,

adLockPessimistic, 1
Quote:

> RstBreedString = "SELECT [Ref-Breed].Breed From [Ref-Breed] ORDER BY
> [Ref-Breed].Breed"
> RstBreed.Open RstBreedString, PCVetCon, adOpenStatic,

adLockPessimistic, 1
Quote:

> RstOwnerString = "SELECT [Dat-People].PersonID, [SName] + ', ' +
[Title] + '
> ' + [FName] AS FullName From [Dat-People] ORDER BY [Dat-People].SName"
> RstOwner.Open RstOwnerString, PCVetCon, adOpenStatic,

adLockPessimistic, 1

- Show quoted text -

Quote:

> RstSexString = "SELECT [Ref-Sex].Sex From [Ref-Sex] ORDER BY [Ref-
Sex].Sex"
> RstSex.Open RstSexString, PCVetCon, adOpenStatic, adLockPessimistic, 1

> DoEvents
> showWorking "Loading Animal Data"

> DoEvents

> DoEvents
> showWorking "Linking Data Fields"

>  With Me.TextAnimalID
>     Set .DataSource = rst
>     .DataField = "AnimalID"
> End With

> With Me.TextAnimal_Name
>     Set .DataSource = rst
>     .DataField = "AnimalName"
> End With

> With Me.DataComboOwner
>     Set .RowSource = RstOwner
>     .ListField = "FullName"
>     .BoundColumn = "PersonID"
>     Set .DataSource = rst
>     .DataField = "PersonID"
> End With

> With Me.DataComboBreed
>     Set .RowSource = RstBreed
>     .BoundColumn = "Breed"
>     .ListField = "Breed"
>     Set .DataSource = rst
>     .DataField = "Breed"
> End With

> With Me.DataComboColour
>     Set .RowSource = RstColour
>     .BoundColumn = "Colour"
>     .ListField = "Colour"
>     Set .DataSource = rst
>     .DataField = "Colour"
> End With

> With Me.TextNotes
>     Set .DataSource = rst
>     .DataField = "Notes"
> End With

> With Me.DataComboStatus
>     Set .RowSource = RstStatus
>     .BoundColumn = "Status"
>     .ListField = "Status"
>     Set .DataSource = rst
>     .DataField = "Status"
> End With

> With Me.TextWarning
>     Set .DataSource = rst
>     .DataField = "Warning"
> End With

> With Me.TextDateOfBirth
>     Set .DataSource = rst
>     .DataField = "DateOfBirth"
> End With

> With Me.DataComboSex
>     Set .RowSource = RstSex
>     .BoundColumn = "Sex"
>     .ListField = "Sex"
>     Set .DataSource = rst
>     .DataField = "Sex"
> End With

> With Me.Checkdesexed
>     Set .DataSource = rst
>     .DataField = "Desexed"
> End With

> With Me.TextDateDesexed
>     Set .DataSource = rst
>     .DataField = "DesexedDate"
> End With

> With Me.TextLastModified
>     Set .DataSource = rst
>     .DataField = "LastModified"
> End With

> HideWorking
> Exit Sub
> Form_Load_Err:
> Select Case Err.Number
> Case 1

> Case Else
>     MsgBox Err.Number & " " & Err.Description
>     Resume Next
> End Select
> End Sub

> The connection comes from within another routine that does..

> PCVetCon.Provider = "Microsoft.Jet.OLEDB.4.0"
> DoEvents
> PCVetCon.Properties("Jet OLEDB:System database") = PathToWorkGroupFile
> PCVetCon.Open PathToCurrentData, "veterinarian", ""
> 'this appear to work as planned within other forms

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


Tue, 04 Dec 2001 03:00:00 GMT  
 ADO error on recordset.update
Check out:
http://support.microsoft.com/support/kb/articles/q195/6/38.asp
I think this may clear up your problem.  It helped me with a similar
one.  (After two days of bashing my head into the wall trying to
figure out where the error was)

On Tue, 15 Jun 1999 21:10:38 +0800, "Mike Whitaker"

Quote:

>RunTime error 2147217888(80040e20)
>Provider called a method from IrowsetNotify in the consumer and the method
>has not yet returned

>is generated at the rst.update line in the save routine below

>Any ideas would save my sanity right now!
>This is my first big VB6 ADO project, thus any hints or experiences would be
>great

>Thanks (sorry about the amount of code here, but I am getting really
>stressed with this one...)

>Mike Whitaker

>Private Sub mnuDataSaveAnimal_Click()
>On Error GoTo mnuDataSaveAnimal_Click_Err
>If rst.EditMode = adEditAdd Then
>    rst("AnimalID").Value = GetNewIDString("dat-Animals", "AnimalID")
>ElseIf rst.EditMode = adEditInProgress Then
>    rst("AnimalID").Value = Me.TextAnimalID
>End If
>    rst("PersonID").Value = Me.DataComboOwner.BoundText
>    rst("AnimalName").Value = Me.TextAnimal_Name
>    rst("Breed").Value = Me.DataComboBreed.BoundText
>    rst("Colour").Value = Me.DataComboColour.BoundText
>    rst("DateOfBirth").Value = CDate(Me.TextDateOfBirth)
>    rst("Status").Value = Me.DataComboStatus.BoundText
>    'rst("Notes").Value = Me.TextNotes
>    rst("Warning").Value = Me.TextWarning
>    rst("Sex").Value = Me.DataComboSex.BoundText
>    rst("Desexed").Value = CBool(Me.Checkdesexed)
>    rst("DesexedDate").Value = CDate(Me.TextDateDesexed)
>    rst("LastModified").Value = Now()
>    rst.Update

>SetReadOnly

>Exit Sub
>mnuDataSaveAnimal_Click_Err:

>Select Case Err.Number
>Case 3260 'record locked by another user
>    MsgBox "The record that you are trying to update is locked by another
>user, please try again later.", vbCritical, AppName
>Case Else
>    MsgBox Err.Number & " " & Err.Description
>End Select
>On Error Resume Next

>rst.CancelUpdate
>SetReadOnly
>End Sub

>Other routines are

>Private Sub mnuDataNewAnimal_Click()
>On Error GoTo mnuDataNewAnimal_Click_Err

>SetEditMode
>'ClearCells
>rst.AddNew

>end Sub

>Private Sub Form_Load()
>On Error GoTo Form_Load_Err

>Dim RstStatusString As String
>Dim RstColourString As String
>Dim RstBreedString As String
>Dim RstOwnerString As String
>Dim RstSexString As String

>Dim x As New ADODB.Command

>showWorking "Setting up form colours"

>Me.BackColor = RGB(rgbRedSub, rgbGreenSub, rgbBlueSub)
>Me.SSTab1.BackColor = RGB(rgbRedSub, rgbGreenSub, rgbBlueSub)

>SetReadOnly
>showWorking "Finding Data"
>S = "SELECT [Dat-Animals].* From [Dat-Animals] ORDER BY
>[Dat-Animals].[AnimalName]"
>rst.Open S, PCVetCon, adOpenDynamic, adLockPessimistic, 1

>RstStatusString = "SELECT [Ref-Status].* From [Ref-Status] ORDER BY
>[Ref-Status].Status"
>RstStatus.Open RstStatusString, PCVetCon, adOpenStatic, adLockPessimistic, 1

>RstColourString = "SELECT [Ref-Animal-Colour].* From [Ref-Animal-Colour]
>ORDER BY [Ref-Animal-Colour].Colour"
>RstColour.Open RstColourString, PCVetCon, adOpenStatic, adLockPessimistic, 1

>RstBreedString = "SELECT [Ref-Breed].Breed From [Ref-Breed] ORDER BY
>[Ref-Breed].Breed"
>RstBreed.Open RstBreedString, PCVetCon, adOpenStatic, adLockPessimistic, 1

>RstOwnerString = "SELECT [Dat-People].PersonID, [SName] + ', ' + [Title] + '
>' + [FName] AS FullName From [Dat-People] ORDER BY [Dat-People].SName"
>RstOwner.Open RstOwnerString, PCVetCon, adOpenStatic, adLockPessimistic, 1

>RstSexString = "SELECT [Ref-Sex].Sex From [Ref-Sex] ORDER BY [Ref-Sex].Sex"
>RstSex.Open RstSexString, PCVetCon, adOpenStatic, adLockPessimistic, 1

>DoEvents
>showWorking "Loading Animal Data"

>DoEvents

>DoEvents
>showWorking "Linking Data Fields"

> With Me.TextAnimalID
>    Set .DataSource = rst
>    .DataField = "AnimalID"
>End With

>With Me.TextAnimal_Name
>    Set .DataSource = rst
>    .DataField = "AnimalName"
>End With

>With Me.DataComboOwner
>    Set .RowSource = RstOwner
>    .ListField = "FullName"
>    .BoundColumn = "PersonID"
>    Set .DataSource = rst
>    .DataField = "PersonID"
>End With

>With Me.DataComboBreed
>    Set .RowSource = RstBreed
>    .BoundColumn = "Breed"
>    .ListField = "Breed"
>    Set .DataSource = rst
>    .DataField = "Breed"
>End With

>With Me.DataComboColour
>    Set .RowSource = RstColour
>    .BoundColumn = "Colour"
>    .ListField = "Colour"
>    Set .DataSource = rst
>    .DataField = "Colour"
>End With

>With Me.TextNotes
>    Set .DataSource = rst
>    .DataField = "Notes"
>End With

>With Me.DataComboStatus
>    Set .RowSource = RstStatus
>    .BoundColumn = "Status"
>    .ListField = "Status"
>    Set .DataSource = rst
>    .DataField = "Status"
>End With

>With Me.TextWarning
>    Set .DataSource = rst
>    .DataField = "Warning"
>End With

>With Me.TextDateOfBirth
>    Set .DataSource = rst
>    .DataField = "DateOfBirth"
>End With

>With Me.DataComboSex
>    Set .RowSource = RstSex
>    .BoundColumn = "Sex"
>    .ListField = "Sex"
>    Set .DataSource = rst
>    .DataField = "Sex"
>End With

>With Me.Checkdesexed
>    Set .DataSource = rst
>    .DataField = "Desexed"
>End With

>With Me.TextDateDesexed
>    Set .DataSource = rst
>    .DataField = "DesexedDate"
>End With

>With Me.TextLastModified
>    Set .DataSource = rst
>    .DataField = "LastModified"
>End With

>HideWorking
>Exit Sub
>Form_Load_Err:
>Select Case Err.Number
>Case 1

>Case Else
>    MsgBox Err.Number & " " & Err.Description
>    Resume Next
>End Select
>End Sub

>The connection comes from within another routine that does..

>PCVetCon.Provider = "Microsoft.Jet.OLEDB.4.0"
>DoEvents
>PCVetCon.Properties("Jet OLEDB:System database") = PathToWorkGroupFile
>PCVetCon.Open PathToCurrentData, "veterinarian", ""
>'this appear to work as planned within other forms



Sat, 08 Dec 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. ADO error on recordset.update

2. ADO Recordset Update Error

3. ADO Recordset Update Error

4. ADO recordset update ORACLE error!!!

5. handling error when update ADO Recordset (VB6, ADO2.5, SQL 7)

6. ADO recordset Update Error

7. ADO Error: -2147217864 when updating a recordset

8. Update error in ADO recordset

9. Update error in ADO recordset

10. Bound controls not updating ADO with adodc.recordset.update command

11. When updating recordset I get error -2147467259 (to many rows affected by update)

12. Batch update for multiple tables using single ADO Recordset (VB )

 

 
Powered by phpBB® Forum Software