open table or recordset "ALIAS"

  • Thread starter Thread starter Mike D
  • Start date Start date
M

Mike D

Using Foxpro, you can open a table ALIAS as another name. As well you can
open it in (0,or1,or2,or3 ....) as well either shared or exclusive..

Example.. use table1 alias table2 in 0 shared

What would the same method be in Access 2000 using ADO. or How would I
createa recordset the same way?

I am asking here because I have and old foxpro 2.6 app that I have been
babying for 2 years trying to get the go ahead to re-write and this is my
starting point..
 
Mike said:
Using Foxpro, you can open a table ALIAS as another name. As well
you can open it in (0,or1,or2,or3 ....) as well either shared or
exclusive..

Example.. use table1 alias table2 in 0 shared

What would the same method be in Access 2000 using ADO. or How would
I createa recordset the same way?

I am asking here because I have and old foxpro 2.6 app that I have
been babying for 2 years trying to get the go ahead to re-write and
this is my starting point..


I have to say that I have always found it to be quite unproductive to
attempt to emulate the programming methods of one database in another.
Foxpro and Access use very different approaches to doing things, so I'd
say it would be more productive to do things the Access way in this
case.

Access can link to and/or import the Foxpro data tables. When you have
those, you can set up the Table relationships, Queries, Forms and
Reports using Access VBA etc.

I think the concept of Table aliasing is somewhat alien to Access. You
just point to the data you want.

hth

Hugh
 
That is correct and you can do pretty much do that in db application.

However I am trying to develop this application in access to truly test its
capabilites with full error handling.

I will show you a simple procedure I use in fox. I would like to see access
handle it the same way. Only for the fact to see if it can.

If I do direct linking to access tables. With 10 to 20 users in a networked
environment. Then I am truly asking for trouble by not using recordsets. And
there are times I have to create a record set that relates back to itself.

FOXPRO SAMPLE 1:
*
IF .NOT. USED ('table1')
IF .NOT. File ('table1.dbf')
? ["TABLE1.DBF" not found]
WAIT
QUIT
EndIF .NOT. File ("table1.dbf")
use table1 alias table 1 in 0 shared
ENDIF .NOT USED ('Table1')

*
*
*

OK Here is some simple error checking to see if the table has been opened or
not if not it opens the table and later creates the indexes and after that
also adds error checking and index re-creating options to keep the tables
synched.


In Access Is this needed? Required? or Optimally safe?

I was handed this app 2 years ago and learned the hard way about data
corruption. And this old fox stuff is hell to maintain..
 
Mike said:
That is correct and you can do pretty much do that in db application.

However I am trying to develop this application in access to truly
test its capabilites with full error handling.

I will show you a simple procedure I use in fox. I would like to see
access handle it the same way. Only for the fact to see if it can.

If I do direct linking to access tables. With 10 to 20 users in a
networked environment. Then I am truly asking for trouble by not
using recordsets. And there are times I have to create a record set
that relates back to itself.

FOXPRO SAMPLE 1:
*
IF .NOT. USED ('table1')
IF .NOT. File ('table1.dbf')
? ["TABLE1.DBF" not found]
WAIT
QUIT
EndIF .NOT. File ("table1.dbf")
use table1 alias table 1 in 0 shared
ENDIF .NOT USED ('Table1')

*
*
*

OK Here is some simple error checking to see if the table has been
opened or not if not it opens the table and later creates the indexes
and after that also adds error checking and index re-creating options
to keep the tables synched.


In Access Is this needed? Required? or Optimally safe?

I was handed this app 2 years ago and learned the hard way about data
corruption. And this old fox stuff is hell to maintain..
Hugh O'Neill said:
I have to say that I have always found it to be quite unproductive
to attempt to emulate the programming methods of one database in
another. Foxpro and Access use very different approaches to doing
things, so I'd say it would be more productive to do things the
Access way in this case.

Access can link to and/or import the Foxpro data tables. When you
have those, you can set up the Table relationships, Queries, Forms
and Reports using Access VBA etc.

I think the concept of Table aliasing is somewhat alien to Access.
You just point to the data you want.

hth

Hugh


In a multi-user environment there's no problem if you have a copy of
the front end on each user's PC linked to the back end shared Tables on
the server.

You don't need to open Tabels specifically in Access; a bound form or
recordset wil do that for you automatically. With 'Table synching' and
indexing, Access has a number of tools such as Requery and Refresh that
probably do what you are asking.

For error checking, Access enables you to trap errors either to carry
out actions or to display user-friendly messages of your own design.

hth

Hugh
 
Back
Top