How to use a cursor/view as xxx.DBC 
Author Message
 How to use a cursor/view as xxx.DBC

Hi!
I use remote views via ODBC to connect to an SQL servers database. The  vfp
.dbc stores connections, and connections store login names, passwords and
database name. Now I use as many copy of the .DBC in a directory tree
stucture as many database I need to reach.  How can I use 'temporary' .DBC
(that is created for one user from one .DBC when he starts the program)
instead of using the .DBC itself.
Is it possible?

Thanks

Pohl Andrs



Sun, 04 Sep 2005 00:07:52 GMT  
 How to use a cursor/view as xxx.DBC
Pohl,
Yes. How about the code at http://fox.wikis.com/wc.dll?Wiki~CreatingDBCforViews~VFP?

Rick

Quote:

> Hi!
> I use remote views via ODBC to connect to an SQL servers database. The  vfp
> .dbc stores connections, and connections store login names, passwords and
> database name. Now I use as many copy of the .DBC in a directory tree
> stucture as many database I need to reach.  How can I use 'temporary' .DBC
> (that is created for one user from one .DBC when he starts the program)
> instead of using the .DBC itself.
> Is it possible?

> Thanks

> Pohl Andrs



Sun, 04 Sep 2005 03:08:26 GMT  
 How to use a cursor/view as xxx.DBC
Thanks Rick!

Some further questions.

- To solve the .dbc locking problems i open the shared database with
'shared noupdate' .

I asked how to use a 'copy' of the common .dbc not because locking problems,
but for reaching a lot of sql databases. In the 'copy' .dbf the program
easily can modify the database name in the connection.

- My .DBC contains only view definitions and connections, so a good old dos
'copy' can be much simplier than the lot of tricks making a copy replacing
the share.dbc. Isn't it?

- If the application uses the local copy of the .dbc, what about running the
application more the once?

Andrew Pohl



Quote:
> Pohl,
> Yes. How about the code at

http://fox.wikis.com/wc.dll?Wiki~CreatingDBCforViews~VFP?
Quote:

> Rick




Quote:
> > Hi!
> > I use remote views via ODBC to connect to an SQL servers database. The
vfp
> > .dbc stores connections, and connections store login names, passwords
and
> > database name. Now I use as many copy of the .DBC in a directory tree
> > stucture as many database I need to reach.  How can I use 'temporary'
.DBC
> > (that is created for one user from one .DBC when he starts the program)
> > instead of using the .DBC itself.
> > Is it possible?

> > Thanks

> > Pohl Andrs



Sun, 04 Sep 2005 22:10:32 GMT  
 How to use a cursor/view as xxx.DBC
Pohl,
I believe the "locking" problem is because VFP locks the header of the DBC, so it probably doesn't
matter how you open the DBCs.

Getting the local copy of your DBC any way that works is just fine!

If you have the possibility of running multiple times on a single system, then just use the "normal"
way of dealling with this situation. Because DBC's can't be opened with an alias, you have to stay
with a fixed name like "LocalViewsDBC.DBC" for the file itself, BUT you can use sys(2015) or maybe
just sys(3) to create a temp directory name and put the DBC into it for multiple apps. You'll just
need to cleanup both the table and the directory when you quit.

Rick

Quote:

> Thanks Rick!

> Some further questions.

> - To solve the .dbc locking problems i open the shared database with
> 'shared noupdate' .

> I asked how to use a 'copy' of the common .dbc not because locking problems,
> but for reaching a lot of sql databases. In the 'copy' .dbf the program
> easily can modify the database name in the connection.

> - My .DBC contains only view definitions and connections, so a good old dos
> 'copy' can be much simplier than the lot of tricks making a copy replacing
> the share.dbc. Isn't it?

> - If the application uses the local copy of the .dbc, what about running the
> application more the once?

> Andrew Pohl



> > Pohl,
> > Yes. How about the code at
> http://fox.wikis.com/wc.dll?Wiki~CreatingDBCforViews~VFP?

> > Rick



> > > Hi!
> > > I use remote views via ODBC to connect to an SQL servers database. The
> vfp
> > > .dbc stores connections, and connections store login names, passwords
> and
> > > database name. Now I use as many copy of the .DBC in a directory tree
> > > stucture as many database I need to reach.  How can I use 'temporary'
> .DBC
> > > (that is created for one user from one .DBC when he starts the program)
> > > instead of using the .DBC itself.
> > > Is it possible?

> > > Thanks

> > > Pohl Andrs



Sun, 04 Sep 2005 22:38:13 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Record is used by another (109) error using REMOTE VIEW CURSORS

2. Programmatic DEs with local views that use cursors from another DBC

3. REPORT FORM xxx TO FILE xxx QUESTION...

4. Error using cursor when selection criteria uses local variables

5. Creating a View using a remote view to Oracle

6. view designer says error when using mssql functions in remote views

7. Using Views as basis for other views

8. Creating a local view using CREATE SQL VIEW

9. ODBC access to a DBC's views?

10. DBC Views

11. .DBC/View definition Multiuser Conflicts...

12. Pack a dbc-table from a remote view???

 

 
Powered by phpBB® Forum Software