Each workstation that will be used to access Oracle needs the following:
The next assumption is that SQL*Net version 2.x is being used. You will need software from Oracle which is usually delivered on a CD-ROM - "Oracle Products for Windows/Win95/NT." The title should be close to what I have quoted, but the products absolutely have to be for the client and not the server. A SQL*Net license has to be purchased for each computer it is installed on. You may also consider purchasing a SQL*Plus license for each developer and for those "advanced" users who may be placed in charge of managing the database/data. If your client workstations do not all have CD-ROM drives, you can load the Oracle CD-ROM on a server and map to it from each workstation in order to install the necessary software.
Oracle will install most of its products in directory structure under C:\ORAWIN for Windows 3.1 and C:\ORAWIN95 for Win95. The C:\ORAWIN(95)\BIN directory is referred to as the Oracle home directory and must be in the workstation PATH environment.
In the C:\ORAWIN(95)\NETWORK\ADMIN directory is where the TNSNAMES.ORA file must be located. This file contains information on how SQL*Net connects to your data source. A sample of this file can be found in the SAMPLES subdirectory under ADMIN. Keep in mind, this is real client-server, and it does not matter where the server is or where the client is. I access an Oracle database in North Carolina from my client workstation in Dallas. As long as you (the client) are on the same side as any server firewall, you can connect to the Oracle server. If you are "outside" your organization (e.g., from a home computer), you could get a permanent TCP/IP address assigned to your computer that falls under your organization's domain. This effectively puts you on the same side of the firewall and gets you access to the server.
A semi-real example of a TNSNAMES.ORA file is given below (a few key data elements have been changed to protect the identity and location of the real database).
################ # Filename......: tnsnames.ora # Name..........: # Date..........: 2-24-97 ################ MyDbName = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (COMMUNITY = TCP.DOMAIN.GOV) (PROTOCOL = TCP) (HOST = 999.99.999.99) (PORT = 1234) ) ) (CONNECT_DATA = (SID = sidw) ) )
Creating an Oracle data source is done through the ODBC Administrator. Start the ODBC Administrator and click the Add button. From the list box, select the Oracle driver. In the form that comes up next, you will enter the Data Source Name (DSN) and Description. The DSN should be a short name. The Description, while needed, is not critical to the connection; just fill in with descriptive enough information so you know what database you are connecting to. The 3rd field is the user ID (optional). The 4th field is the SQL*Net Connect String which, in my example TNSNAMES.ORA example above, would be MyDbName. That is all there is to this step.
You can also create the ODBC data source programmatically. See the Microsoft knowledge base article on how this is done http://support.microsoft.com/support/, then search for article Q142216 which gives 2 non-Oracle examples. This is the only example I know of, but it should be sufficient as a starting point to trying this method for an Oracle data source. What has worked for me is the following.
lparameters lcODBCDriver, lcSettings * * For example: * * lcODBCDriver "Microsoft ODBC for Oracle" * lcSettings "DSN=Locator"+chr(0); * +"Description=Region 6 Locator"+chr(0); * +"Server=OraServer"+chr(0); * +"UID=optional" * if parameters() <> 2 return .f. endif if type("lcODBCDriver") <> "C" or empty(lcODBCDriver) return .f. endif if type("lcSettings") <> "C" or empty(lcSettings) return .f. endif if right(lcSettings, 1) <> chr(0) lcSettings = lcSettings + chr(0) endif #define ODBC_ADD_DSN 1 && included so you know what #define ODBC_CONFIG_DSN 2 && can be passed as 2<SUP>nd</SUP> parameter #define ODBC_REMOVE_DSN 3 #define ODBC_ADD_SYS_DSN 4 #define ODBC_CONFIG_SYS_DSN 5 #define ODBC_REMOVE_SYS_DSN 6 #define ODBC_REMOVE_DEFAULT_DSN 7 DECLARE Integer SQLConfigDataSource in odbccp32 ; Integer, Integer, String, String lnSuccess=SQLConfigDataSource(0,ODBC_ADD_DSN,lcODBCDriver,lcSettings) return iif(lnSuccess > 0, .t., .f.) <HR>
The third parameter in SQLConfigDataSource must be the exact driver name from the ODBC Administrator. In my case, we are using the MS 32-bit ODBC driver. The actual name you have to use for this driver is Microsoft ODBC for Oracle. Success is equal to 1 if successful, Zero if it fails. This function will automatically add 4 entries or more in the registry - the 3 listed above and the appropriate MS ODBC DLL file the ODBC driver uses. The number of entries depends on the number of parameters defined in the listings parameter. You should use the ODBC Administrator to create one yourself, then look in the registry to see what parameters were defined. Look in HKEY_CURRENT_USER\Software\ODBC\ODBC.INI of the registry.
At this point, you should now have a TCP/IP address for your workstation (this is left up to your Network Administrator to do), and have installed SQL*Net and the MS ODBC drivers. Your Oracle data source has been defined either manually through the ODBC Administrator or programmatically. You are now ready to launch VFP and start developing or upsizing your front-end application using an Oracle database.
Microsoft has an on-line Knowledge Base at http://support.microsoft.com/support/ which has much information on ODBC and Oracle. On this search page, I would select ODBC in Step 1, and type in Oracle in Step 5. The search engine will return all the pertinent articles. Good luck!