error 3188 record locked

  • Thread starter Thread starter iccsi
  • Start date Start date
I

iccsi

I got 3188 run time error locked error 3188 and did some research
online.
It seems that user tried to update a text field with more than 2048
characters.

I would like to delete the record and add back on the table when users
gets 3188 error.

I did some test that I can update some text field has shorter message.
The only thing is that I am able to update the long text field which
has more than 2048 characters only one form open.

User gets 3188 when 2 forms opened.
It looks like the other form lock the record, but I do not change any
code.
User only get 3188 when user update long field with 2 form open.

Any advise that I am on the right tracker,

Your information is great appreciated,
 
:
I got 3188 run time error locked error 3188 and did some research
online.
It seems that user tried to update a text field with more than
2048 characters.

Can you give the URL you're basing your assessment on? I can't think
of any reason why a field that allows 2048 characters (a memo field)
would suddenly disallow anything more than that.
 
m:

(http://tinyurl.com/3373c7f)

Access Monster is just a site repackaging Usenet posts, so you could
get to the same place through Google Groups.

Anyway, I have seen related issues, though the truncation problems
started at 255 characters in the context I was encountering it.

Anyway, the solution was to avoid ByRef proplems and to always pass
stuff ByVal. This meant forcing evaluation of objects or storing
values in variables before using them.

In the situation cited in that article, this:

rst![details] = Me.details1

....would be changed to:

rst![details] = (Me.details1)

....or to this:

strDetails = Me.details1
rst![details] = strDetails

Also, it could be that this kind of thing can be done in a SQL
update, but not in recordset.

You don't really give details about what exact code you are
encountering the problem with. Perhaps if you'd supply that, obvious
solutions would be apparent.
 
m:





(http://tinyurl.com/3373c7f)

Access Monster is just a site repackaging Usenet posts, so you could
get to the same place through Google Groups.

Anyway, I have seen related issues, though the truncation problems
started at 255 characters in the context I was encountering it.

Anyway, the solution was to avoid ByRef proplems and to always pass
stuff ByVal. This meant forcing evaluation of objects or storing
values in variables before using them.

In the situation cited in that article, this:

  rst![details] = Me.details1

...would be changed to:

  rst![details] = (Me.details1)

...or to this:

  strDetails = Me.details1
  rst![details] = strDetails

Also, it could be that this kind of thing can be done in a SQL
update, but not in recordset.

You don't really give details about what exact code you are
encountering the problem with. Perhaps if you'd supply that, obvious
solutions would be apparent.

I have a lookup form and details form.
User may double click on lookup form to go to details form.

Lookup form is bounded, but details form unbounded.

When user clicks on OK button I have following code to update details
table, because this is unbound form.

dim strMYSQL as string

strMYSQL = " UPDATE tblDetails Set MyComments = MyTextControls.value
WHERE MyKeysValue = MyKeysContorls.value

CurrentDB.execute strMYSQL dbFailOnError


The execute SQL statement fails when lookup form opened and comments
more than 2048 characters in comments controls.


Thanks again,
 
m:
When user clicks on OK button I have following code to update
details table, because this is unbound form.

dim strMYSQL as string

strMYSQL = " UPDATE tblDetails Set MyComments =
MyTextControls.value
WHERE MyKeysValue = MyKeysContorls.value

CurrentDB.execute strMYSQL dbFailOnError

The execute SQL statement fails when lookup form opened and
comments more than 2048 characters in comments controls.

CurrentDB.Execute doesn't use the Access/Jet expression service, so
can't resolve control values.

You have to do that in concatenating the SQL string you pass it:

strMYSQL = "UPDATE tblDetails Set MyComments = " & _
Chr(34) & Me!MyTextControls & Chr(34) & _
WHERE MyKeysValue = " & Me!MyKeysContorls

This assumes that MyComments is text and MyKeysValue is numeric.
 
CurrentDB.Execute doesn't use the Access/Jet expression service, so
can't resolve control values.

You have to do that in concatenating the SQL string you pass it:

 strMYSQL = "UPDATE tblDetails Set MyComments = " & _
      Chr(34) & Me!MyTextControls & Chr(34) & _
   WHERE MyKeysValue = " & Me!MyKeysContorls

This assumes that MyComments is text and MyKeysValue is numeric.

Thanks for helping,
The code fails only when comments has more than 2048 characters and
lookup form is opened.

Thanks again,
 
m:
Thanks for helping,
The code fails only when comments has more than 2048 characters
and lookup form is opened.

What code fails? The concatenation of the string? Or the execution
of the SQL?

Without the concatenation I suggested, CurrentDB.Execute cannot
understand the update statement, since it doesn't know what
Me!MyTextControl is referring to.

Once you've resolved that reference, if there's an error occuring it
must be in the execution of the SQL update, not in the query
processor's ability to understand it.
 
Back
Top