Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setting ODBC
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00557845
Message ID:
00561451
Views:
38
You need to look at the code where the DSN 'Oracle Test' Created - .T. was created. Modify this code to create your DSN. You can remove the DSN off your computer and test recreating it with my class and that code.
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.  && optional. default is false
oODBC = newobject('odbc', 'odbc.fxp', llModifyDSN)
llSuccess = oODBC.CreateUserDSN(lcDriverName, lcSettings)
oODBC.Release()
return
Look in the ODBCDemo.PRG file for instanciation code and study the ODBC_Examples procedure in ODBC.PRG to see how this works.

>OK I got it to work, the results:!!
>
>MS ODBC for Oracle Installed - .T.
>MS ODBC for Oracle Version - 02.50
>DSN 'VFP DBC Test' Created - .T.
>DSN 'VFP DBC Test' Removed - .T.
>DSN 'Oracle Test' Created - .T.
>DSN 'Oracle Test' Current Description = Test Addition of DSN
>DSN 'Oracle Test' Modified - .T.
>DSN 'Oracle Test' New Description = Descript Modified
>DSN 'Oracle Test' Removed - .T.
>
>Now, what can I do to make this useful, do I use my connection string to connect?
>
>Since on my PC, the control panel/ODBC mgr had already been in place and configured so my prg(see below) already worked. What I want to do is have it work on other systems.
>
>{lnHandle = SQLConnect("connect1")
>
>IF lnHandle > -1
> SQLExec(lnHandle,"SELECT * FROM amcs_equipment","Result1")
> SELECT Result1
> BROWSE
> SQLDisconnect(lnHandle)
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform