You are not reading what I am posting. The ODBC.PRG is THE CLASS. I am giving you the code you need below to create your DSN. You have to modify the code below with your own parameters. I have no idea what host name you have in your TNSNAMES.ORA file. Read the VFP help on Newobject() function. Trace through my code in ODBCDemo.prg and the methods it calls in the ODBC.prg file so you can learn how to work with PRG-based classes.
>>Post your modified code of what I given you below. I never recommend embedding a password in the DSN. I just create the DSN and use it to open a dummy remote view after the user Provides their UserID and Password in a VFP form. You have to use the Host name you created in the TNSNAMES.ORA file for the Server parameter.
>>
>>>>Too much cuttin'-and-pastin':
>>>>#INCLUDE ODBC.H
>>>>lcDriverName = ODBC_MS_ORACLE
>>>>lcSettings = "DSN=Connect1_or_better_description" + chr(0);
>>>> + "Description=Your_Description_Here" + chr(0);
>>>> + "Server=host_name_in_tnsnames.ora_file"+chr(0);
>>>> + "UID=myuserid"
>>>>llModifyDSN = .f.
>>>>oODBC = newobject('odbc', 'odbc.fxp')
>>>>llSuccess = oODBC.CreateUserDSN(lcDriverName, lcSettings, <b>llModifyDSN</b>)
>>>>oODBC.Release
>>>>return llSuccess
>>>
>>>I get .f. for llSuccess. DO I have all things in place? So I need odbc.prg with my parameters in place and the code above also with my parameters in place. How come the code above does not ask for a PWD? Again is the concept to create a user dsn then be able to SQLExec() for some oracle server data?
>>>-possibly hopelessly lost
>
>ok, so after this runs, I still .f. for llSuccess. what would be the next step.
>Also, can you tell me if I still need odbc.prg with my parameters in place.
>-TB
Mark McCasland
Midlothian, TX USA