Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Configuring ODBC on the fly

Status
Not open for further replies.

phita

Programmer
Jun 8, 2001
82
KE
Hi folks,
Is there a way that one can create a data source programatically instead of using the ODBC setup in the control panel ? This is coz I want to use an Access table (.MDB) to create a Remote View in Visual Foxpro 6.0. My client has legacy data in Access hence the need for a Remote View. I am using VFP as the front-end, using Remote Views to update the data in Access tables.

Currently, I have to create a data source manually. Or is there a utility/API that I can use to create a data source without involving the user ?

Please help,

Phita.
 
Hi!

It is possible by using ODBC API functions, but...

You can create a temporary database, create the connection in it and create the remote view by VFP commands in run-time. When creating connection you will be able to specify all the parameters required to connect to the Access database using ODBC connection string.
Vlad Grynchyshyn
vgryn@softserve.lviv.ua
The professional level of programmer could be determined by level of stupidity of his/her bugs
 
Good to know that this is possible. Can you please show me how to do this from within Visual Foxpro. I haven't the slightest idea. I haven't used APIs before so please give me an idea on how to do it.

Thanks,

Phita.
 
You can also create a DSN-less connection, which does not require setting up a DSN in ODBC. For more info, see FAQ: faq184-65
Robert Bradley
Support operation moo!
Visit the OpCow page to help in this cause
 
I do not have samples because I always use DSNless connection and creating the connection and view on the fly. The API functions name is SQLConfigDataSource, you can find a help on it in the MSDN. Then take a look to the samples of working with API function, you can find a lot of them here and at the
Look to following download:



Vlad Grynchyshyn
vgryn@softserve.lviv.ua
The professional level of programmer could be determined by level of stupidity of his/her bugs
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top