error # 2147217887

  • Thread starter Thread starter Tadeo Giner
  • Start date Start date
T

Tadeo Giner

Hi everybody

I have a stored procedure like a record source:

ALTER PROCEDURE [dbo].[SPVistaClientes]
AS
SELECT [Código de Cliente],
[Código del Proveedor],
[ID de Cliente],
[Código ALKO],
[CIF/DNI],
[Razón Social],
Nombre,
Dirección,
Fax,
Movil,
[Telefono 2],
[Telefono 1],
[E-Mail],
Web,
[Código Postal],
[Fecha de Alta],
[Código de Banco],
Banco,
[Código de Sucursal],
[Código de Cuenta],
[DC 1],
[DC 2],
[Dirección de la Sucursal],
[Población de la Sucursal],
[Dia de Pago 1],
[Dia de Pago 2],
[Dia de Pago 3],
Portes,
[Descuento Pronto Pago],
Observaciones,
[Cuenta Bloqueada],
Población,
Clientes.[ID de Población],
Clientes.[ID de Grupo de Compras],
Clientes.[ID de Forma de Pago],
Provincia,
[Grupo de Compras],
[Forma de Pago]
FROM dbo.Provincias RIGHT OUTER JOIN
dbo.Poblaciones RIGHT OUTER JOIN
dbo.[Grupo de Compras] RIGHT OUTER JOIN
dbo.Clientes LEFT OUTER JOIN
dbo.[Formas de Pago] ON dbo.Clientes.[ID de Forma de Pago] = dbo.[Formas de
Pago].[ID de Forma de Pago] ON
dbo.[Grupo de Compras].[ID de Grupo de Compras] = dbo.Clientes.[ID de Grupo
de Compras] ON
dbo.Poblaciones.[ID de Población] = dbo.Clientes.[ID de Población] ON
dbo.Provincias.[ID de Provincia] = dbo.Poblaciones.[ID de Provincia]

RETURN


And an access procedure to find a record

Private Sub Código_de_Cliente_Change()
On Error GoTo etiqueta
Dim criterios As String
Dim miconsulta As New ADODB.Recordset
DoCmd.Hourglass True
Set miconsulta = Me.RecordsetClone
criterios = "[ID de Cliente]= " & Me![Código del Proveedor].Column(2)
With miconsulta
.Find criterios
Me![Código del Proveedor].Value = Me![Código del Proveedor].OldValue
If .EOF Then
MsgBox "No se encuentra el Código del Proveedor: " & Me![Código del
Proveedor].Value
Else
Me.Bookmark = .Bookmark
End If
End With
DoCmd.Hourglass False
etiqueta:
If Err.Number <> 0 Then
MsgBox "Error # " & str(Err.Number) & " was generated by " & Err.Source & "
" & Err.Description
End If
End sub

I always have the result Error # -2147217887 by Microsoft cursor engine in
the sentence

..find criterios

Can you help me? I don´t understand what happens with the sp

I use sbs 2003, sqlserver express and access 2003

Thanks
 
First, don't use the NEW operator followed by a Set statement:

Dim miconsulta As ADODB.Recordset
Set miconsulta = ...

and not:
Dim miconsulta As New ADODB.Recordset
Set miconsulta = ...

Second, don't use Me.RecordsetClone with ADP as it's verry buggy, use
Me.Recordset.Clone instead.

Also, I don't remember if you must use a .MoveFirst or a bookmark after
setting the value of miconsulta to a clone but it would not be a bad idea to
do so:

Set miconsulta = Me.Recordset.Clone
miconsultat.MoveFirst

Make sure that the recordset is not at EOF would also be a good idea. After
that, if you still have problem, try replacing « [ID de Cliente] » with
something else:

Select [ID de Cliente] as IdDeClient, ....
...
Find = "IdDeClient= ...."

Some types of field (BIGINT for example) or the use of special caracters
like Código could also be the source of your problem; so you should make
some test using only a few columns and a standard caracters set.

Finally, I don't know what's your point of using a Select statement without
a Where condition but if your idea is to use instead a Find, you're likely
going to have some severe performance problems.

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)


Tadeo Giner said:
Hi everybody

I have a stored procedure like a record source:

ALTER PROCEDURE [dbo].[SPVistaClientes]
AS
SELECT [Código de Cliente],
[Código del Proveedor],
[ID de Cliente],
[Código ALKO],
[CIF/DNI],
[Razón Social],
Nombre,
Dirección,
Fax,
Movil,
[Telefono 2],
[Telefono 1],
[E-Mail],
Web,
[Código Postal],
[Fecha de Alta],
[Código de Banco],
Banco,
[Código de Sucursal],
[Código de Cuenta],
[DC 1],
[DC 2],
[Dirección de la Sucursal],
[Población de la Sucursal],
[Dia de Pago 1],
[Dia de Pago 2],
[Dia de Pago 3],
Portes,
[Descuento Pronto Pago],
Observaciones,
[Cuenta Bloqueada],
Población,
Clientes.[ID de Población],
Clientes.[ID de Grupo de Compras],
Clientes.[ID de Forma de Pago],
Provincia,
[Grupo de Compras],
[Forma de Pago]
FROM dbo.Provincias RIGHT OUTER JOIN
dbo.Poblaciones RIGHT OUTER JOIN
dbo.[Grupo de Compras] RIGHT OUTER JOIN
dbo.Clientes LEFT OUTER JOIN
dbo.[Formas de Pago] ON dbo.Clientes.[ID de Forma de Pago] = dbo.[Formas
de Pago].[ID de Forma de Pago] ON
dbo.[Grupo de Compras].[ID de Grupo de Compras] = dbo.Clientes.[ID de
Grupo de Compras] ON
dbo.Poblaciones.[ID de Población] = dbo.Clientes.[ID de Población] ON
dbo.Provincias.[ID de Provincia] = dbo.Poblaciones.[ID de Provincia]

RETURN


And an access procedure to find a record

Private Sub Código_de_Cliente_Change()
On Error GoTo etiqueta
Dim criterios As String
Dim miconsulta As New ADODB.Recordset
DoCmd.Hourglass True
Set miconsulta = Me.RecordsetClone
criterios = "[ID de Cliente]= " & Me![Código del Proveedor].Column(2)
With miconsulta
.Find criterios
Me![Código del Proveedor].Value = Me![Código del Proveedor].OldValue
If .EOF Then
MsgBox "No se encuentra el Código del Proveedor: " & Me![Código del
Proveedor].Value
Else
Me.Bookmark = .Bookmark
End If
End With
DoCmd.Hourglass False
etiqueta:
If Err.Number <> 0 Then
MsgBox "Error # " & str(Err.Number) & " was generated by " & Err.Source &
" " & Err.Description
End If
End sub

I always have the result Error # -2147217887 by Microsoft cursor engine in
the sentence

.find criterios

Can you help me? I don´t understand what happens with the sp

I use sbs 2003, sqlserver express and access 2003

Thanks
 
Dear Sylvain
Thanks for your complete answer,

I have done all the changes you tell me, when I do:
dim miconsulta as adodb.recordset
set miconsulta=me.recordset.clone <--

All the informations in the screen became #Deleted, and appears
the error 3001 was generated by adbodb.recordset, Incorrect argumets etc etc
in the sentece .find criterios

I don´t have the change
select... because first I think that I have to correct the sentece
set miconsulta...

Can you help me?
Thanks
PD: sorry for my english

Sylvain Lafontaine said:
First, don't use the NEW operator followed by a Set statement:

Dim miconsulta As ADODB.Recordset
Set miconsulta = ...

and not:
Dim miconsulta As New ADODB.Recordset
Set miconsulta = ...

Second, don't use Me.RecordsetClone with ADP as it's verry buggy, use
Me.Recordset.Clone instead.

Also, I don't remember if you must use a .MoveFirst or a bookmark after
setting the value of miconsulta to a clone but it would not be a bad idea
to do so:

Set miconsulta = Me.Recordset.Clone
miconsultat.MoveFirst

Make sure that the recordset is not at EOF would also be a good idea.
After that, if you still have problem, try replacing « [ID de Cliente] »
with something else:

Select [ID de Cliente] as IdDeClient, ....
...
Find = "IdDeClient= ...."

Some types of field (BIGINT for example) or the use of special caracters
like Código could also be the source of your problem; so you should make
some test using only a few columns and a standard caracters set.

Finally, I don't know what's your point of using a Select statement
without a Where condition but if your idea is to use instead a Find,
you're likely going to have some severe performance problems.

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)


Tadeo Giner said:
Hi everybody

I have a stored procedure like a record source:

ALTER PROCEDURE [dbo].[SPVistaClientes]
AS
SELECT [Código de Cliente],
[Código del Proveedor],
[ID de Cliente],
[Código ALKO],
[CIF/DNI],
[Razón Social],
Nombre,
Dirección,
Fax,
Movil,
[Telefono 2],
[Telefono 1],
[E-Mail],
Web,
[Código Postal],
[Fecha de Alta],
[Código de Banco],
Banco,
[Código de Sucursal],
[Código de Cuenta],
[DC 1],
[DC 2],
[Dirección de la Sucursal],
[Población de la Sucursal],
[Dia de Pago 1],
[Dia de Pago 2],
[Dia de Pago 3],
Portes,
[Descuento Pronto Pago],
Observaciones,
[Cuenta Bloqueada],
Población,
Clientes.[ID de Población],
Clientes.[ID de Grupo de Compras],
Clientes.[ID de Forma de Pago],
Provincia,
[Grupo de Compras],
[Forma de Pago]
FROM dbo.Provincias RIGHT OUTER JOIN
dbo.Poblaciones RIGHT OUTER JOIN
dbo.[Grupo de Compras] RIGHT OUTER JOIN
dbo.Clientes LEFT OUTER JOIN
dbo.[Formas de Pago] ON dbo.Clientes.[ID de Forma de Pago] = dbo.[Formas
de Pago].[ID de Forma de Pago] ON
dbo.[Grupo de Compras].[ID de Grupo de Compras] = dbo.Clientes.[ID de
Grupo de Compras] ON
dbo.Poblaciones.[ID de Población] = dbo.Clientes.[ID de Población] ON
dbo.Provincias.[ID de Provincia] = dbo.Poblaciones.[ID de Provincia]

RETURN


And an access procedure to find a record

Private Sub Código_de_Cliente_Change()
On Error GoTo etiqueta
Dim criterios As String
Dim miconsulta As New ADODB.Recordset
DoCmd.Hourglass True
Set miconsulta = Me.RecordsetClone
criterios = "[ID de Cliente]= " & Me![Código del Proveedor].Column(2)
With miconsulta
.Find criterios
Me![Código del Proveedor].Value = Me![Código del Proveedor].OldValue
If .EOF Then
MsgBox "No se encuentra el Código del Proveedor: " & Me![Código
del Proveedor].Value
Else
Me.Bookmark = .Bookmark
End If
End With
DoCmd.Hourglass False
etiqueta:
If Err.Number <> 0 Then
MsgBox "Error # " & str(Err.Number) & " was generated by " & Err.Source &
" " & Err.Description
End If
End sub

I always have the result Error # -2147217887 by Microsoft cursor engine
in the sentence

.find criterios

Can you help me? I don´t understand what happens with the sp

I use sbs 2003, sqlserver express and access 2003

Thanks
 
Very strange. Did you use Me.RecordsetClone somewhere else against the same
recordset and what version of Access are you using?

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)


Tadeo Giner said:
Dear Sylvain
Thanks for your complete answer,

I have done all the changes you tell me, when I do:
dim miconsulta as adodb.recordset
set miconsulta=me.recordset.clone <--

All the informations in the screen became #Deleted, and appears
the error 3001 was generated by adbodb.recordset, Incorrect argumets etc
etc
in the sentece .find criterios

I don´t have the change
select... because first I think that I have to correct the sentece
set miconsulta...

Can you help me?
Thanks
PD: sorry for my english

Sylvain Lafontaine said:
First, don't use the NEW operator followed by a Set statement:

Dim miconsulta As ADODB.Recordset
Set miconsulta = ...

and not:
Dim miconsulta As New ADODB.Recordset
Set miconsulta = ...

Second, don't use Me.RecordsetClone with ADP as it's verry buggy, use
Me.Recordset.Clone instead.

Also, I don't remember if you must use a .MoveFirst or a bookmark after
setting the value of miconsulta to a clone but it would not be a bad idea
to do so:

Set miconsulta = Me.Recordset.Clone
miconsultat.MoveFirst

Make sure that the recordset is not at EOF would also be a good idea.
After that, if you still have problem, try replacing « [ID de Cliente] »
with something else:

Select [ID de Cliente] as IdDeClient, ....
...
Find = "IdDeClient= ...."

Some types of field (BIGINT for example) or the use of special caracters
like Código could also be the source of your problem; so you should make
some test using only a few columns and a standard caracters set.

Finally, I don't know what's your point of using a Select statement
without a Where condition but if your idea is to use instead a Find,
you're likely going to have some severe performance problems.

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)


Tadeo Giner said:
Hi everybody

I have a stored procedure like a record source:

ALTER PROCEDURE [dbo].[SPVistaClientes]
AS
SELECT [Código de Cliente],
[Código del Proveedor],
[ID de Cliente],
[Código ALKO],
[CIF/DNI],
[Razón Social],
Nombre,
Dirección,
Fax,
Movil,
[Telefono 2],
[Telefono 1],
[E-Mail],
Web,
[Código Postal],
[Fecha de Alta],
[Código de Banco],
Banco,
[Código de Sucursal],
[Código de Cuenta],
[DC 1],
[DC 2],
[Dirección de la Sucursal],
[Población de la Sucursal],
[Dia de Pago 1],
[Dia de Pago 2],
[Dia de Pago 3],
Portes,
[Descuento Pronto Pago],
Observaciones,
[Cuenta Bloqueada],
Población,
Clientes.[ID de Población],
Clientes.[ID de Grupo de Compras],
Clientes.[ID de Forma de Pago],
Provincia,
[Grupo de Compras],
[Forma de Pago]
FROM dbo.Provincias RIGHT OUTER JOIN
dbo.Poblaciones RIGHT OUTER JOIN
dbo.[Grupo de Compras] RIGHT OUTER JOIN
dbo.Clientes LEFT OUTER JOIN
dbo.[Formas de Pago] ON dbo.Clientes.[ID de Forma de Pago] = dbo.[Formas
de Pago].[ID de Forma de Pago] ON
dbo.[Grupo de Compras].[ID de Grupo de Compras] = dbo.Clientes.[ID de
Grupo de Compras] ON
dbo.Poblaciones.[ID de Población] = dbo.Clientes.[ID de Población] ON
dbo.Provincias.[ID de Provincia] = dbo.Poblaciones.[ID de Provincia]

RETURN


And an access procedure to find a record

Private Sub Código_de_Cliente_Change()
On Error GoTo etiqueta
Dim criterios As String
Dim miconsulta As New ADODB.Recordset
DoCmd.Hourglass True
Set miconsulta = Me.RecordsetClone
criterios = "[ID de Cliente]= " & Me![Código del Proveedor].Column(2)
With miconsulta
.Find criterios
Me![Código del Proveedor].Value = Me![Código del Proveedor].OldValue
If .EOF Then
MsgBox "No se encuentra el Código del Proveedor: " & Me![Código
del Proveedor].Value
Else
Me.Bookmark = .Bookmark
End If
End With
DoCmd.Hourglass False
etiqueta:
If Err.Number <> 0 Then
MsgBox "Error # " & str(Err.Number) & " was generated by " & Err.Source
& " " & Err.Description
End If
End sub

I always have the result Error # -2147217887 by Microsoft cursor engine
in the sentence

.find criterios

Can you help me? I don´t understand what happens with the sp

I use sbs 2003, sqlserver express and access 2003

Thanks
 
Are you sure that there is a primary key defined for this table and did you
take the precaution of setting the UniqueTable and the ResyncCommand
properties and how exactly is this SP called as the record source of the
form (are you using an EXEC string or not) ? With a query as complex as
this one, you should always set up the UniqueTable and the ResyncCommand
properties.

Have you any other problems besides moving the current record; for example,
any trouble editing the form?

You can also take a look with the SQL-Server Profiler to make sure that
nothing strange is made or called by Access on the SQL-Server.

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)


Tadeo Giner said:
I use access 2003 and sqlserver express, I just use the me.recordset.clone
when I have to find a record. I´m loosing my mind looking for the bug.

The screen with #deleted always appear, with me.recordsetclone and with
me.recordset.clone

you can see the attached file error

Thanks for your help



Sylvain Lafontaine said:
Very strange. Did you use Me.RecordsetClone somewhere else against the
same
recordset and what version of Access are you using?

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)


Tadeo Giner said:
Dear Sylvain
Thanks for your complete answer,

I have done all the changes you tell me, when I do:
dim miconsulta as adodb.recordset
set miconsulta=me.recordset.clone <--

All the informations in the screen became #Deleted, and appears
the error 3001 was generated by adbodb.recordset, Incorrect argumets etc
etc
in the sentece .find criterios

I don´t have the change
select... because first I think that I have to correct the sentece
set miconsulta...

Can you help me?
Thanks
PD: sorry for my english

"Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
escribió en el mensaje First, don't use the NEW operator followed by a Set statement:

Dim miconsulta As ADODB.Recordset
Set miconsulta = ...

and not:
Dim miconsulta As New ADODB.Recordset
Set miconsulta = ...

Second, don't use Me.RecordsetClone with ADP as it's verry buggy, use
Me.Recordset.Clone instead.

Also, I don't remember if you must use a .MoveFirst or a bookmark after
setting the value of miconsulta to a clone but it would not be a bad
idea
to do so:

Set miconsulta = Me.Recordset.Clone
miconsultat.MoveFirst

Make sure that the recordset is not at EOF would also be a good idea.
After that, if you still have problem, try replacing « [ID de
Cliente] »
with something else:

Select [ID de Cliente] as IdDeClient, ....
...
Find = "IdDeClient= ...."

Some types of field (BIGINT for example) or the use of special
caracters
like Código could also be the source of your problem; so you should
make
some test using only a few columns and a standard caracters set.

Finally, I don't know what's your point of using a Select statement
without a Where condition but if your idea is to use instead a Find,
you're likely going to have some severe performance problems.

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)


Hi everybody

I have a stored procedure like a record source:

ALTER PROCEDURE [dbo].[SPVistaClientes]
AS
SELECT [Código de Cliente],
[Código del Proveedor],
[ID de Cliente],
[Código ALKO],
[CIF/DNI],
[Razón Social],
Nombre,
Dirección,
Fax,
Movil,
[Telefono 2],
[Telefono 1],
[E-Mail],
Web,
[Código Postal],
[Fecha de Alta],
[Código de Banco],
Banco,
[Código de Sucursal],
[Código de Cuenta],
[DC 1],
[DC 2],
[Dirección de la Sucursal],
[Población de la Sucursal],
[Dia de Pago 1],
[Dia de Pago 2],
[Dia de Pago 3],
Portes,
[Descuento Pronto Pago],
Observaciones,
[Cuenta Bloqueada],
Población,
Clientes.[ID de Población],
Clientes.[ID de Grupo de Compras],
Clientes.[ID de Forma de Pago],
Provincia,
[Grupo de Compras],
[Forma de Pago]
FROM dbo.Provincias RIGHT OUTER JOIN
dbo.Poblaciones RIGHT OUTER JOIN
dbo.[Grupo de Compras] RIGHT OUTER JOIN
dbo.Clientes LEFT OUTER JOIN
dbo.[Formas de Pago] ON dbo.Clientes.[ID de Forma de Pago] =
dbo.[Formas
de Pago].[ID de Forma de Pago] ON
dbo.[Grupo de Compras].[ID de Grupo de Compras] = dbo.Clientes.[ID de
Grupo de Compras] ON
dbo.Poblaciones.[ID de Población] = dbo.Clientes.[ID de Población] ON
dbo.Provincias.[ID de Provincia] = dbo.Poblaciones.[ID de Provincia]

RETURN


And an access procedure to find a record

Private Sub Código_de_Cliente_Change()
On Error GoTo etiqueta
Dim criterios As String
Dim miconsulta As New ADODB.Recordset
DoCmd.Hourglass True
Set miconsulta = Me.RecordsetClone
criterios = "[ID de Cliente]= " & Me![Código del Proveedor].Column(2)
With miconsulta
.Find criterios
Me![Código del Proveedor].Value = Me![Código del
Proveedor].OldValue
If .EOF Then
MsgBox "No se encuentra el Código del Proveedor: " & Me![Código
del Proveedor].Value
Else
Me.Bookmark = .Bookmark
End If
End With
DoCmd.Hourglass False
etiqueta:
If Err.Number <> 0 Then
MsgBox "Error # " & str(Err.Number) & " was generated by " &
Err.Source
& " " & Err.Description
End If
End sub

I always have the result Error # -2147217887 by Microsoft cursor
engine
in the sentence

.find criterios

Can you help me? I don´t understand what happens with the sp

I use sbs 2003, sqlserver express and access 2003

Thanks
 
Sorry, ResyncComand NO, This is my first adp project, What is
ResyncComand????
I put UniqueTable (Clientes) and the name of sp (recordource) in property
window. The primary key is [Id de Cliente]
I´m to study what is ResyncCommand, I don´t know nothing about it

Thanks a lot

Sylvain Lafontaine said:
Are you sure that there is a primary key defined for this table and did
you take the precaution of setting the UniqueTable and the ResyncCommand
properties and how exactly is this SP called as the record source of the
form (are you using an EXEC string or not) ? With a query as complex as
this one, you should always set up the UniqueTable and the ResyncCommand
properties.

Have you any other problems besides moving the current record; for
example, any trouble editing the form?

You can also take a look with the SQL-Server Profiler to make sure that
nothing strange is made or called by Access on the SQL-Server.

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)


Tadeo Giner said:
I use access 2003 and sqlserver express, I just use the me.recordset.clone
when I have to find a record. I´m loosing my mind looking for the bug.

The screen with #deleted always appear, with me.recordsetclone and with
me.recordset.clone

you can see the attached file error

Thanks for your help



Sylvain Lafontaine said:
Very strange. Did you use Me.RecordsetClone somewhere else against the
same
recordset and what version of Access are you using?

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)


Dear Sylvain
Thanks for your complete answer,

I have done all the changes you tell me, when I do:
dim miconsulta as adodb.recordset
set miconsulta=me.recordset.clone <--

All the informations in the screen became #Deleted, and appears
the error 3001 was generated by adbodb.recordset, Incorrect argumets
etc
etc
in the sentece .find criterios

I don´t have the change
select... because first I think that I have to correct the sentece
set miconsulta...

Can you help me?
Thanks
PD: sorry for my english

"Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
escribió en el mensaje First, don't use the NEW operator followed by a Set statement:

Dim miconsulta As ADODB.Recordset
Set miconsulta = ...

and not:
Dim miconsulta As New ADODB.Recordset
Set miconsulta = ...

Second, don't use Me.RecordsetClone with ADP as it's verry buggy, use
Me.Recordset.Clone instead.

Also, I don't remember if you must use a .MoveFirst or a bookmark
after
setting the value of miconsulta to a clone but it would not be a bad
idea
to do so:

Set miconsulta = Me.Recordset.Clone
miconsultat.MoveFirst

Make sure that the recordset is not at EOF would also be a good idea.
After that, if you still have problem, try replacing « [ID de
Cliente] »
with something else:

Select [ID de Cliente] as IdDeClient, ....
...
Find = "IdDeClient= ...."

Some types of field (BIGINT for example) or the use of special
caracters
like Código could also be the source of your problem; so you should
make
some test using only a few columns and a standard caracters set.

Finally, I don't know what's your point of using a Select statement
without a Where condition but if your idea is to use instead a Find,
you're likely going to have some severe performance problems.

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)


Hi everybody

I have a stored procedure like a record source:

ALTER PROCEDURE [dbo].[SPVistaClientes]
AS
SELECT [Código de Cliente],
[Código del Proveedor],
[ID de Cliente],
[Código ALKO],
[CIF/DNI],
[Razón Social],
Nombre,
Dirección,
Fax,
Movil,
[Telefono 2],
[Telefono 1],
[E-Mail],
Web,
[Código Postal],
[Fecha de Alta],
[Código de Banco],
Banco,
[Código de Sucursal],
[Código de Cuenta],
[DC 1],
[DC 2],
[Dirección de la Sucursal],
[Población de la Sucursal],
[Dia de Pago 1],
[Dia de Pago 2],
[Dia de Pago 3],
Portes,
[Descuento Pronto Pago],
Observaciones,
[Cuenta Bloqueada],
Población,
Clientes.[ID de Población],
Clientes.[ID de Grupo de Compras],
Clientes.[ID de Forma de Pago],
Provincia,
[Grupo de Compras],
[Forma de Pago]
FROM dbo.Provincias RIGHT OUTER JOIN
dbo.Poblaciones RIGHT OUTER JOIN
dbo.[Grupo de Compras] RIGHT OUTER JOIN
dbo.Clientes LEFT OUTER JOIN
dbo.[Formas de Pago] ON dbo.Clientes.[ID de Forma de Pago] =
dbo.[Formas
de Pago].[ID de Forma de Pago] ON
dbo.[Grupo de Compras].[ID de Grupo de Compras] = dbo.Clientes.[ID de
Grupo de Compras] ON
dbo.Poblaciones.[ID de Población] = dbo.Clientes.[ID de Población] ON
dbo.Provincias.[ID de Provincia] = dbo.Poblaciones.[ID de Provincia]

RETURN


And an access procedure to find a record

Private Sub Código_de_Cliente_Change()
On Error GoTo etiqueta
Dim criterios As String
Dim miconsulta As New ADODB.Recordset
DoCmd.Hourglass True
Set miconsulta = Me.RecordsetClone
criterios = "[ID de Cliente]= " & Me![Código del Proveedor].Column(2)
With miconsulta
.Find criterios
Me![Código del Proveedor].Value = Me![Código del
Proveedor].OldValue
If .EOF Then
MsgBox "No se encuentra el Código del Proveedor: " &
Me![Código
del Proveedor].Value
Else
Me.Bookmark = .Bookmark
End If
End With
DoCmd.Hourglass False
etiqueta:
If Err.Number <> 0 Then
MsgBox "Error # " & str(Err.Number) & " was generated by " &
Err.Source
& " " & Err.Description
End If
End sub

I always have the result Error # -2147217887 by Microsoft cursor
engine
in the sentence

.find criterios

Can you help me? I don´t understand what happens with the sp

I use sbs 2003, sqlserver express and access 2003

Thanks
 
Dear Sylvain

THANK YOU VERY MUCH

The error was the ResyncCommand, I´ve put the same sp in the ResyncCommand
and al works very very well

Thanks for your help,
Tadeo Giner

Sylvain Lafontaine said:
Are you sure that there is a primary key defined for this table and did
you take the precaution of setting the UniqueTable and the ResyncCommand
properties and how exactly is this SP called as the record source of the
form (are you using an EXEC string or not) ? With a query as complex as
this one, you should always set up the UniqueTable and the ResyncCommand
properties.

Have you any other problems besides moving the current record; for
example, any trouble editing the form?

You can also take a look with the SQL-Server Profiler to make sure that
nothing strange is made or called by Access on the SQL-Server.

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)


Tadeo Giner said:
I use access 2003 and sqlserver express, I just use the me.recordset.clone
when I have to find a record. I´m loosing my mind looking for the bug.

The screen with #deleted always appear, with me.recordsetclone and with
me.recordset.clone

you can see the attached file error

Thanks for your help



Sylvain Lafontaine said:
Very strange. Did you use Me.RecordsetClone somewhere else against the
same
recordset and what version of Access are you using?

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)


Dear Sylvain
Thanks for your complete answer,

I have done all the changes you tell me, when I do:
dim miconsulta as adodb.recordset
set miconsulta=me.recordset.clone <--

All the informations in the screen became #Deleted, and appears
the error 3001 was generated by adbodb.recordset, Incorrect argumets
etc
etc
in the sentece .find criterios

I don´t have the change
select... because first I think that I have to correct the sentece
set miconsulta...

Can you help me?
Thanks
PD: sorry for my english

"Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
escribió en el mensaje First, don't use the NEW operator followed by a Set statement:

Dim miconsulta As ADODB.Recordset
Set miconsulta = ...

and not:
Dim miconsulta As New ADODB.Recordset
Set miconsulta = ...

Second, don't use Me.RecordsetClone with ADP as it's verry buggy, use
Me.Recordset.Clone instead.

Also, I don't remember if you must use a .MoveFirst or a bookmark
after
setting the value of miconsulta to a clone but it would not be a bad
idea
to do so:

Set miconsulta = Me.Recordset.Clone
miconsultat.MoveFirst

Make sure that the recordset is not at EOF would also be a good idea.
After that, if you still have problem, try replacing « [ID de
Cliente] »
with something else:

Select [ID de Cliente] as IdDeClient, ....
...
Find = "IdDeClient= ...."

Some types of field (BIGINT for example) or the use of special
caracters
like Código could also be the source of your problem; so you should
make
some test using only a few columns and a standard caracters set.

Finally, I don't know what's your point of using a Select statement
without a Where condition but if your idea is to use instead a Find,
you're likely going to have some severe performance problems.

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)


Hi everybody

I have a stored procedure like a record source:

ALTER PROCEDURE [dbo].[SPVistaClientes]
AS
SELECT [Código de Cliente],
[Código del Proveedor],
[ID de Cliente],
[Código ALKO],
[CIF/DNI],
[Razón Social],
Nombre,
Dirección,
Fax,
Movil,
[Telefono 2],
[Telefono 1],
[E-Mail],
Web,
[Código Postal],
[Fecha de Alta],
[Código de Banco],
Banco,
[Código de Sucursal],
[Código de Cuenta],
[DC 1],
[DC 2],
[Dirección de la Sucursal],
[Población de la Sucursal],
[Dia de Pago 1],
[Dia de Pago 2],
[Dia de Pago 3],
Portes,
[Descuento Pronto Pago],
Observaciones,
[Cuenta Bloqueada],
Población,
Clientes.[ID de Población],
Clientes.[ID de Grupo de Compras],
Clientes.[ID de Forma de Pago],
Provincia,
[Grupo de Compras],
[Forma de Pago]
FROM dbo.Provincias RIGHT OUTER JOIN
dbo.Poblaciones RIGHT OUTER JOIN
dbo.[Grupo de Compras] RIGHT OUTER JOIN
dbo.Clientes LEFT OUTER JOIN
dbo.[Formas de Pago] ON dbo.Clientes.[ID de Forma de Pago] =
dbo.[Formas
de Pago].[ID de Forma de Pago] ON
dbo.[Grupo de Compras].[ID de Grupo de Compras] = dbo.Clientes.[ID de
Grupo de Compras] ON
dbo.Poblaciones.[ID de Población] = dbo.Clientes.[ID de Población] ON
dbo.Provincias.[ID de Provincia] = dbo.Poblaciones.[ID de Provincia]

RETURN


And an access procedure to find a record

Private Sub Código_de_Cliente_Change()
On Error GoTo etiqueta
Dim criterios As String
Dim miconsulta As New ADODB.Recordset
DoCmd.Hourglass True
Set miconsulta = Me.RecordsetClone
criterios = "[ID de Cliente]= " & Me![Código del Proveedor].Column(2)
With miconsulta
.Find criterios
Me![Código del Proveedor].Value = Me![Código del
Proveedor].OldValue
If .EOF Then
MsgBox "No se encuentra el Código del Proveedor: " &
Me![Código
del Proveedor].Value
Else
Me.Bookmark = .Bookmark
End If
End With
DoCmd.Hourglass False
etiqueta:
If Err.Number <> 0 Then
MsgBox "Error # " & str(Err.Number) & " was generated by " &
Err.Source
& " " & Err.Description
End If
End sub

I always have the result Error # -2147217887 by Microsoft cursor
engine
in the sentence

.find criterios

Can you help me? I don´t understand what happens with the sp

I use sbs 2003, sqlserver express and access 2003

Thanks
 
The same exact SP? It would be better to set another SP using the primary
key of the current record as its single parameter and calling it in the
following way (the exact name is not important) in the ResyncCommand:

MySP_Resync ?

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)


Tadeo Giner said:
Dear Sylvain

THANK YOU VERY MUCH

The error was the ResyncCommand, I´ve put the same sp in the ResyncCommand
and al works very very well

Thanks for your help,
Tadeo Giner

Sylvain Lafontaine said:
Are you sure that there is a primary key defined for this table and did
you take the precaution of setting the UniqueTable and the ResyncCommand
properties and how exactly is this SP called as the record source of the
form (are you using an EXEC string or not) ? With a query as complex as
this one, you should always set up the UniqueTable and the ResyncCommand
properties.

Have you any other problems besides moving the current record; for
example, any trouble editing the form?

You can also take a look with the SQL-Server Profiler to make sure that
nothing strange is made or called by Access on the SQL-Server.

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)


Tadeo Giner said:
I use access 2003 and sqlserver express, I just use the
me.recordset.clone
when I have to find a record. I´m loosing my mind looking for the bug.

The screen with #deleted always appear, with me.recordsetclone and with
me.recordset.clone

you can see the attached file error

Thanks for your help



"Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
escribió en el mensaje Very strange. Did you use Me.RecordsetClone somewhere else against the
same
recordset and what version of Access are you using?

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)


Dear Sylvain
Thanks for your complete answer,

I have done all the changes you tell me, when I do:
dim miconsulta as adodb.recordset
set miconsulta=me.recordset.clone <--

All the informations in the screen became #Deleted, and appears
the error 3001 was generated by adbodb.recordset, Incorrect argumets
etc
etc
in the sentece .find criterios

I don´t have the change
select... because first I think that I have to correct the sentece
set miconsulta...

Can you help me?
Thanks
PD: sorry for my english

"Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam
please)>
escribió en el mensaje First, don't use the NEW operator followed by a Set statement:

Dim miconsulta As ADODB.Recordset
Set miconsulta = ...

and not:
Dim miconsulta As New ADODB.Recordset
Set miconsulta = ...

Second, don't use Me.RecordsetClone with ADP as it's verry buggy, use
Me.Recordset.Clone instead.

Also, I don't remember if you must use a .MoveFirst or a bookmark
after
setting the value of miconsulta to a clone but it would not be a bad
idea
to do so:

Set miconsulta = Me.Recordset.Clone
miconsultat.MoveFirst

Make sure that the recordset is not at EOF would also be a good idea.
After that, if you still have problem, try replacing « [ID de
Cliente] »
with something else:

Select [ID de Cliente] as IdDeClient, ....
...
Find = "IdDeClient= ...."

Some types of field (BIGINT for example) or the use of special
caracters
like Código could also be the source of your problem; so you should
make
some test using only a few columns and a standard caracters set.

Finally, I don't know what's your point of using a Select statement
without a Where condition but if your idea is to use instead a Find,
you're likely going to have some severe performance problems.

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)


Hi everybody

I have a stored procedure like a record source:

ALTER PROCEDURE [dbo].[SPVistaClientes]
AS
SELECT [Código de Cliente],
[Código del Proveedor],
[ID de Cliente],
[Código ALKO],
[CIF/DNI],
[Razón Social],
Nombre,
Dirección,
Fax,
Movil,
[Telefono 2],
[Telefono 1],
[E-Mail],
Web,
[Código Postal],
[Fecha de Alta],
[Código de Banco],
Banco,
[Código de Sucursal],
[Código de Cuenta],
[DC 1],
[DC 2],
[Dirección de la Sucursal],
[Población de la Sucursal],
[Dia de Pago 1],
[Dia de Pago 2],
[Dia de Pago 3],
Portes,
[Descuento Pronto Pago],
Observaciones,
[Cuenta Bloqueada],
Población,
Clientes.[ID de Población],
Clientes.[ID de Grupo de Compras],
Clientes.[ID de Forma de Pago],
Provincia,
[Grupo de Compras],
[Forma de Pago]
FROM dbo.Provincias RIGHT OUTER JOIN
dbo.Poblaciones RIGHT OUTER JOIN
dbo.[Grupo de Compras] RIGHT OUTER JOIN
dbo.Clientes LEFT OUTER JOIN
dbo.[Formas de Pago] ON dbo.Clientes.[ID de Forma de Pago] =
dbo.[Formas
de Pago].[ID de Forma de Pago] ON
dbo.[Grupo de Compras].[ID de Grupo de Compras] = dbo.Clientes.[ID
de
Grupo de Compras] ON
dbo.Poblaciones.[ID de Población] = dbo.Clientes.[ID de Población]
ON
dbo.Provincias.[ID de Provincia] = dbo.Poblaciones.[ID de Provincia]

RETURN


And an access procedure to find a record

Private Sub Código_de_Cliente_Change()
On Error GoTo etiqueta
Dim criterios As String
Dim miconsulta As New ADODB.Recordset
DoCmd.Hourglass True
Set miconsulta = Me.RecordsetClone
criterios = "[ID de Cliente]= " & Me![Código del
Proveedor].Column(2)
With miconsulta
.Find criterios
Me![Código del Proveedor].Value = Me![Código del
Proveedor].OldValue
If .EOF Then
MsgBox "No se encuentra el Código del Proveedor: " &
Me![Código
del Proveedor].Value
Else
Me.Bookmark = .Bookmark
End If
End With
DoCmd.Hourglass False
etiqueta:
If Err.Number <> 0 Then
MsgBox "Error # " & str(Err.Number) & " was generated by " &
Err.Source
& " " & Err.Description
End If
End sub

I always have the result Error # -2147217887 by Microsoft cursor
engine
in the sentence

.find criterios

Can you help me? I don´t understand what happens with the sp

I use sbs 2003, sqlserver express and access 2003

Thanks
 
I´m going to try it, This is my first adp

Sylvain Lafontaine said:
The same exact SP? It would be better to set another SP using the primary
key of the current record as its single parameter and calling it in the
following way (the exact name is not important) in the ResyncCommand:

MySP_Resync ?

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)


Tadeo Giner said:
Dear Sylvain

THANK YOU VERY MUCH

The error was the ResyncCommand, I´ve put the same sp in the
ResyncCommand and al works very very well

Thanks for your help,
Tadeo Giner

Sylvain Lafontaine said:
Are you sure that there is a primary key defined for this table and did
you take the precaution of setting the UniqueTable and the ResyncCommand
properties and how exactly is this SP called as the record source of the
form (are you using an EXEC string or not) ? With a query as complex as
this one, you should always set up the UniqueTable and the ResyncCommand
properties.

Have you any other problems besides moving the current record; for
example, any trouble editing the form?

You can also take a look with the SQL-Server Profiler to make sure that
nothing strange is made or called by Access on the SQL-Server.

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)


I use access 2003 and sqlserver express, I just use the
me.recordset.clone
when I have to find a record. I´m loosing my mind looking for the bug.

The screen with #deleted always appear, with me.recordsetclone and with
me.recordset.clone

you can see the attached file error

Thanks for your help



"Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
escribió en el mensaje Very strange. Did you use Me.RecordsetClone somewhere else against
the
same
recordset and what version of Access are you using?

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)


Dear Sylvain
Thanks for your complete answer,

I have done all the changes you tell me, when I do:
dim miconsulta as adodb.recordset
set miconsulta=me.recordset.clone <--

All the informations in the screen became #Deleted, and appears
the error 3001 was generated by adbodb.recordset, Incorrect argumets
etc
etc
in the sentece .find criterios

I don´t have the change
select... because first I think that I have to correct the sentece
set miconsulta...

Can you help me?
Thanks
PD: sorry for my english

"Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam
please)>
escribió en el mensaje First, don't use the NEW operator followed by a Set statement:

Dim miconsulta As ADODB.Recordset
Set miconsulta = ...

and not:
Dim miconsulta As New ADODB.Recordset
Set miconsulta = ...

Second, don't use Me.RecordsetClone with ADP as it's verry buggy,
use
Me.Recordset.Clone instead.

Also, I don't remember if you must use a .MoveFirst or a bookmark
after
setting the value of miconsulta to a clone but it would not be a bad
idea
to do so:

Set miconsulta = Me.Recordset.Clone
miconsultat.MoveFirst

Make sure that the recordset is not at EOF would also be a good
idea.
After that, if you still have problem, try replacing « [ID de
Cliente] »
with something else:

Select [ID de Cliente] as IdDeClient, ....
...
Find = "IdDeClient= ...."

Some types of field (BIGINT for example) or the use of special
caracters
like Código could also be the source of your problem; so you should
make
some test using only a few columns and a standard caracters set.

Finally, I don't know what's your point of using a Select statement
without a Where condition but if your idea is to use instead a Find,
you're likely going to have some severe performance problems.

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)


Hi everybody

I have a stored procedure like a record source:

ALTER PROCEDURE [dbo].[SPVistaClientes]
AS
SELECT [Código de Cliente],
[Código del Proveedor],
[ID de Cliente],
[Código ALKO],
[CIF/DNI],
[Razón Social],
Nombre,
Dirección,
Fax,
Movil,
[Telefono 2],
[Telefono 1],
[E-Mail],
Web,
[Código Postal],
[Fecha de Alta],
[Código de Banco],
Banco,
[Código de Sucursal],
[Código de Cuenta],
[DC 1],
[DC 2],
[Dirección de la Sucursal],
[Población de la Sucursal],
[Dia de Pago 1],
[Dia de Pago 2],
[Dia de Pago 3],
Portes,
[Descuento Pronto Pago],
Observaciones,
[Cuenta Bloqueada],
Población,
Clientes.[ID de Población],
Clientes.[ID de Grupo de Compras],
Clientes.[ID de Forma de Pago],
Provincia,
[Grupo de Compras],
[Forma de Pago]
FROM dbo.Provincias RIGHT OUTER JOIN
dbo.Poblaciones RIGHT OUTER JOIN
dbo.[Grupo de Compras] RIGHT OUTER JOIN
dbo.Clientes LEFT OUTER JOIN
dbo.[Formas de Pago] ON dbo.Clientes.[ID de Forma de Pago] =
dbo.[Formas
de Pago].[ID de Forma de Pago] ON
dbo.[Grupo de Compras].[ID de Grupo de Compras] = dbo.Clientes.[ID
de
Grupo de Compras] ON
dbo.Poblaciones.[ID de Población] = dbo.Clientes.[ID de Población]
ON
dbo.Provincias.[ID de Provincia] = dbo.Poblaciones.[ID de
Provincia]

RETURN


And an access procedure to find a record

Private Sub Código_de_Cliente_Change()
On Error GoTo etiqueta
Dim criterios As String
Dim miconsulta As New ADODB.Recordset
DoCmd.Hourglass True
Set miconsulta = Me.RecordsetClone
criterios = "[ID de Cliente]= " & Me![Código del
Proveedor].Column(2)
With miconsulta
.Find criterios
Me![Código del Proveedor].Value = Me![Código del
Proveedor].OldValue
If .EOF Then
MsgBox "No se encuentra el Código del Proveedor: " &
Me![Código
del Proveedor].Value
Else
Me.Bookmark = .Bookmark
End If
End With
DoCmd.Hourglass False
etiqueta:
If Err.Number <> 0 Then
MsgBox "Error # " & str(Err.Number) & " was generated by " &
Err.Source
& " " & Err.Description
End If
End sub

I always have the result Error # -2147217887 by Microsoft cursor
engine
in the sentence

.find criterios

Can you help me? I don´t understand what happens with the sp

I use sbs 2003, sqlserver express and access 2003

Thanks
 
I have the changes you told me and it works fine, thanks another time

ta deo Giner

Sylvain Lafontaine said:
The same exact SP? It would be better to set another SP using the primary
key of the current record as its single parameter and calling it in the
following way (the exact name is not important) in the ResyncCommand:

MySP_Resync ?

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)


Tadeo Giner said:
Dear Sylvain

THANK YOU VERY MUCH

The error was the ResyncCommand, I´ve put the same sp in the
ResyncCommand and al works very very well

Thanks for your help,
Tadeo Giner

Sylvain Lafontaine said:
Are you sure that there is a primary key defined for this table and did
you take the precaution of setting the UniqueTable and the ResyncCommand
properties and how exactly is this SP called as the record source of the
form (are you using an EXEC string or not) ? With a query as complex as
this one, you should always set up the UniqueTable and the ResyncCommand
properties.

Have you any other problems besides moving the current record; for
example, any trouble editing the form?

You can also take a look with the SQL-Server Profiler to make sure that
nothing strange is made or called by Access on the SQL-Server.

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)


I use access 2003 and sqlserver express, I just use the
me.recordset.clone
when I have to find a record. I´m loosing my mind looking for the bug.

The screen with #deleted always appear, with me.recordsetclone and with
me.recordset.clone

you can see the attached file error

Thanks for your help



"Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
escribió en el mensaje Very strange. Did you use Me.RecordsetClone somewhere else against
the
same
recordset and what version of Access are you using?

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)


Dear Sylvain
Thanks for your complete answer,

I have done all the changes you tell me, when I do:
dim miconsulta as adodb.recordset
set miconsulta=me.recordset.clone <--

All the informations in the screen became #Deleted, and appears
the error 3001 was generated by adbodb.recordset, Incorrect argumets
etc
etc
in the sentece .find criterios

I don´t have the change
select... because first I think that I have to correct the sentece
set miconsulta...

Can you help me?
Thanks
PD: sorry for my english

"Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam
please)>
escribió en el mensaje First, don't use the NEW operator followed by a Set statement:

Dim miconsulta As ADODB.Recordset
Set miconsulta = ...

and not:
Dim miconsulta As New ADODB.Recordset
Set miconsulta = ...

Second, don't use Me.RecordsetClone with ADP as it's verry buggy,
use
Me.Recordset.Clone instead.

Also, I don't remember if you must use a .MoveFirst or a bookmark
after
setting the value of miconsulta to a clone but it would not be a bad
idea
to do so:

Set miconsulta = Me.Recordset.Clone
miconsultat.MoveFirst

Make sure that the recordset is not at EOF would also be a good
idea.
After that, if you still have problem, try replacing « [ID de
Cliente] »
with something else:

Select [ID de Cliente] as IdDeClient, ....
...
Find = "IdDeClient= ...."

Some types of field (BIGINT for example) or the use of special
caracters
like Código could also be the source of your problem; so you should
make
some test using only a few columns and a standard caracters set.

Finally, I don't know what's your point of using a Select statement
without a Where condition but if your idea is to use instead a Find,
you're likely going to have some severe performance problems.

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)


Hi everybody

I have a stored procedure like a record source:

ALTER PROCEDURE [dbo].[SPVistaClientes]
AS
SELECT [Código de Cliente],
[Código del Proveedor],
[ID de Cliente],
[Código ALKO],
[CIF/DNI],
[Razón Social],
Nombre,
Dirección,
Fax,
Movil,
[Telefono 2],
[Telefono 1],
[E-Mail],
Web,
[Código Postal],
[Fecha de Alta],
[Código de Banco],
Banco,
[Código de Sucursal],
[Código de Cuenta],
[DC 1],
[DC 2],
[Dirección de la Sucursal],
[Población de la Sucursal],
[Dia de Pago 1],
[Dia de Pago 2],
[Dia de Pago 3],
Portes,
[Descuento Pronto Pago],
Observaciones,
[Cuenta Bloqueada],
Población,
Clientes.[ID de Población],
Clientes.[ID de Grupo de Compras],
Clientes.[ID de Forma de Pago],
Provincia,
[Grupo de Compras],
[Forma de Pago]
FROM dbo.Provincias RIGHT OUTER JOIN
dbo.Poblaciones RIGHT OUTER JOIN
dbo.[Grupo de Compras] RIGHT OUTER JOIN
dbo.Clientes LEFT OUTER JOIN
dbo.[Formas de Pago] ON dbo.Clientes.[ID de Forma de Pago] =
dbo.[Formas
de Pago].[ID de Forma de Pago] ON
dbo.[Grupo de Compras].[ID de Grupo de Compras] = dbo.Clientes.[ID
de
Grupo de Compras] ON
dbo.Poblaciones.[ID de Población] = dbo.Clientes.[ID de Población]
ON
dbo.Provincias.[ID de Provincia] = dbo.Poblaciones.[ID de
Provincia]

RETURN


And an access procedure to find a record

Private Sub Código_de_Cliente_Change()
On Error GoTo etiqueta
Dim criterios As String
Dim miconsulta As New ADODB.Recordset
DoCmd.Hourglass True
Set miconsulta = Me.RecordsetClone
criterios = "[ID de Cliente]= " & Me![Código del
Proveedor].Column(2)
With miconsulta
.Find criterios
Me![Código del Proveedor].Value = Me![Código del
Proveedor].OldValue
If .EOF Then
MsgBox "No se encuentra el Código del Proveedor: " &
Me![Código
del Proveedor].Value
Else
Me.Bookmark = .Bookmark
End If
End With
DoCmd.Hourglass False
etiqueta:
If Err.Number <> 0 Then
MsgBox "Error # " & str(Err.Number) & " was generated by " &
Err.Source
& " " & Err.Description
End If
End sub

I always have the result Error # -2147217887 by Microsoft cursor
engine
in the sentence

.find criterios

Can you help me? I don´t understand what happens with the sp

I use sbs 2003, sqlserver express and access 2003

Thanks
 
Back
Top