Re: oracle6 to foxpro

From: Paul Russell <prussell_at_fox.nstn.ns.ca>
Date: 1995/04/12
Message-ID: <19950412021449385.prussell_at_fox.nstn.ns.ca>#1/1


In message Tue, 11 Apr 95 15:36:52 EDT,
  selina_at_dciem.dnd.ca (Selina Glynn) writes:

> I am interested in the same question except I am accessing Oracle 7 on my
> Sun server. I have the ODBC driver, Sqlnet, and presumably the
> connectivity kit setup on my Mac. I read the connectivity kit too, but I
> know nothing about FoxPro. Do you have a sample code that I could have,
> so that I'll have some idea about where to put these Sql calls to Oracle,
> because I have no idea how to program in FoxPro yet. Any help will be
> much appreciated. Many thanks.

I have no experience with the Mac, but I can relate my experiences with FoxPro/Windows and that particular Connectivity Kit. I will assume that doing things on the Mac are somewhat similar.

BTW, this was all done about a year or so ago, so some stuff may have been forgotten or mis-remembered.

  1. Set up Oracle on the back end, complete with SQL*Net. I don't know what was involved with this, as out Unix administrator did all of this.
  2. Set up SQL*Net on the local machine. In our case, this involved messing around mainly with the SERVICES.HLP, HOSTS, and ODBC.INI files. SQL*Net also provides a program to test the connection. All you can do with it is log into Oracle, and log out. You literally can't do _anything_ else.
  3. Call the program from FoxPro. Here is some sample code that should work:
    • Load all of the Connectivity Kit functions SET LIBRARY TO FPSQL
    • Connect to the database. In this case, 'Oracle' is the name of the
    • profile in ODBC.INI that I will be connecting to, and 'scott' and 'tiger'
    • are -- you guessed it -- the username and password. m.lnConnection is
    • the memory variable that will hold the connection number. m.lnConnection = dbconnect("Oracle","scott","tiger")
    • Do something. Everything that you do is through the connection number.
    • Notice that there is no ';' at the end of the SQL command. RESULTS is
    • the name of the cursor that the information will be dumped into. =dbexec(m.lnConnection,"SELECT * FROM USER_TABLES","results")
    • View the results BROWSE
    • Close the connection to the database =dbdisconn(m.lnConnection)

Hope this gets you started.

/Paul

--
+-------------------------+----------------------------------------------+
| Paul Russell            | Phone: 902-481-4582    Fax: 902-468-3679     |
| Software Kinetics Ltd.  | Internet:  russell_at_atl.sofkin.ca             |
| 201 Brownlow Avenue     | Personal:  prussell_at_fox.nstn.ns.ca           |
| Dartmouth               | "Make sure you use technology appropriately, |
| Nova Scotia, Canada     |     not just because it's cool."             |
| B3B 1W2                 |                         - E. Davidson        |
 +-------------------------+----------------------------------------------+
| Contact me about the VISUAL FOXPRO PLUS Seminar -- May 8-12 in Halifax |
| Presented by the Fox Users of Nova Scotia and taught by Alan Schwartz  |
+------------------------------------------------------------------------+
Received on Wed Apr 12 1995 - 00:00:00 CEST

Original text of this message