dsn-less connection  
Author Message
PCSQL66





PostPosted: Visual FoxPro General, dsn-less connection Top

I'm using VFP9 SP1.  I have tables (dbf) which are contained in a database container (e.g. test.dbc).  Now, I want to create another database which will contain remote views to those tables.  I will use dsn-less connection.  What is the difference between a connect string to visual foxpro tables and a connect string to visual foxpro database 

DSN=Visual FoxPro 
Tables;UID=;PWD=;SourceDB=c:;SourceType=DBF;Exclusive=No;BackgroundFetch=Yes;Collate=Machine;Null=Yes;Deleted=Yes;

DSN=Visual FoxPro 
Database;UID=;PWD=;SourceDB=c:\test.dbc;SourceType=DBC;Exclusive=No;BackgroundFetch=Yes;Collate=Machine;Null=Yes;Deleted=Yes; 

Thanks,

Peter


Visual FoxPro1  
 
 
CetinBasoz





PostPosted: Visual FoxPro General, dsn-less connection Top

It's not a remote view but a local view (though you might create as a remote view with a connection string).

If you'd use connection strings then they'd look like:

"Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=c:\myfolder;"
"Driver={Microsoft Visual FoxPro Driver};SourceType=DBC;SourceDB=c:\myFolder\mydatabase.dbc;"


 
 
PCSQL66





PostPosted: Visual FoxPro General, dsn-less connection Top

Hi Cetin,

I'm using remote view because I want to get a connection handle and then issue SPT against the tables. I also want to share connections.

 

Are these dsn-less connection strings I don't think so.

DSN=Visual FoxPro Tables;UID=;PWD=;SourceDB=c:;SourceType=DBF;Exclusive=No;BackgroundFetch=Yes;Collate=Machine;Null=Yes;Deleted=Yes;

DSN=Visual FoxPro
Database;UID=;PWD=;SourceDB=c:\test.dbc;SourceType=DBC;Exclusive=No;BackgroundFetch=Yes;Collate=Machine;Null=Yes;Deleted=Yes;

What is the difference between these dsn-less connection strings

"Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=c:\myfolder;"
"Driver={Microsoft Visual FoxPro Driver};SourceType=DBC;SourceDB=c:\myFolder\mydatabase.dbc;"

The only difference I know is that the 1st one (DBF) will find all the dbfs in the c:\myfolder and the 2nd one (DBC) will find only the dbfs contained in c:\myFolder\mydatabase.dbc.  

Does remote view to VFP tables contained in a dbc will get the field caption from the dbc automatically or I have to assign caption to fields in remote view again

 

Peter

 

 


 

 


 
 
AndyKr





PostPosted: Visual FoxPro General, dsn-less connection Top

The difference is in the "SOURCE" that you specify. If you are accessing tables in a DBC, then you need to reference the DBC explicitly, so that the connection knows how to resolve a table name (which may differ from the physical file name). 

If you are accessing free tables then all you need is the folder name in which the tables reside because, in this case, the table and file names are always the same.

 If you are creating remote views, then you need to specify the details for things like Captions explicitly for the view, but you can get them from the Database - see DBGETPROP() in the Help file for details