Form Recordset Update Error when on network

E

ExcelMan

I have a button on a form that opens another form. The second form is
opened with some opening arguments that specify which record should
display when the form opens.

Such as:

Me.Recordset.MoveFirst
Me.Recordset.Find = "CustomerNum = 29"

This code seems to work fine when the ADP is on the same box as the
SQL Server. But when I split the ADP out to a remote user, the second
form opens to the first record in the recordset, not the specified
record.

What else should I be doing?

Thanks.
 
S

Sylvain Lafontaine

The simplest explanation would be that you don't have a record with
"CustomerNum = 29' in the second case, when you are on the network. Check
for any permission issue between the remote user, his credentials and the
second SQL-Server.
 
E

ExcelMan

The simplest explanation would be that you don't have a record with
"CustomerNum = 29' in the second case, when you are on the network.  Check
for any permission issue between the remote user, his credentials and the
second SQL-Server.
I don't think that is the explanation because of two facts:

1) I am able to access the record when the ADP is run on the same
machine as SQL Server.
2) I am able to access the record when I go into debug mode and step
through the code.

This second fact also addresses the permissions issue. So I have
permissions and the record is available. The real issue has something
to do with what happens when I am connected over a network. BTW, this
seems to occur whether the network is the local LAN or over the
Internet via VPN.

I am guessing it has to do with a timing issue of some sort - maybe
the recordset does not get updated locally (in the ADP) quickly
enough. But I am looking for anyone who has experienced this before
to help.

Thanks.
 
S

Sylvain Lafontaine

Ther are many possibilities here; however, simply telling that you can get
to a record and asking for a solution will probably get you to nowhere. Like
I said, the first thing to do would be to make sure that the record is
there, especially when you need it. Things to look would then be to display
the number of records in a message box, to check if you are at the EOF and
more important, to check with a Loop if you can access the record.

Also, there have been some reports of problem using the RecordsetClone
function; so you should check that you don't make any call to RecordsetClone
but instead use the Recordset.Clone method. The usual method of moving to a
new record would be to create a clone with the Recordset.Clone, then to
search this clone for the record that you want and if you find it, then to
set the bookmark of the main recordset of the form to the same bookmark as
the cloned recordset. Many people will tell you that it's better to use
RecordsetClone instead of Recordset.Clone because the former will use a
cached copy but like I said, there have been many problems of using it
inside an ADP project.

Now, what this has to do with your problem? Possibly nothing but as you
didn't provide any useful detail in your original post; this is probably the
best answer that I can give you at this moment. However, the fact that you
can access when running the debugger in your second post suggest that the
use of RecordsetClone could be a possible explanation; even if you didn't
make any mention of this method.

Another thing to look at would be a possible corruption of the ADP project
file; so you should decompile it or better, import everything into a new
blank project.

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


The simplest explanation would be that you don't have a record with
"CustomerNum = 29' in the second case, when you are on the network. Check
for any permission issue between the remote user, his credentials and the
second SQL-Server.
I don't think that is the explanation because of two facts:

1) I am able to access the record when the ADP is run on the same
machine as SQL Server.
2) I am able to access the record when I go into debug mode and step
through the code.

This second fact also addresses the permissions issue. So I have
permissions and the record is available. The real issue has something
to do with what happens when I am connected over a network. BTW, this
seems to occur whether the network is the local LAN or over the
Internet via VPN.

I am guessing it has to do with a timing issue of some sort - maybe
the recordset does not get updated locally (in the ADP) quickly
enough. But I am looking for anyone who has experienced this before
to help.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top