Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using Registry class
Message
 
To
04/12/2002 10:58:27
Leonid Kizelshteyn
Boston Medical Software, Llc
Massachusetts, United States
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00729460
Message ID:
00729474
Views:
20
This is an old pieces of code I wrote in the past, it create an Oracle DSN called "Dorisdq" if it doesn't exist.
I used it under NT/98, tested 5 minute ago (just before post it) under 2000, seems works.
Use it as jump start

#DEFINE HKEY_CLASSES_ROOT -2147483648 && BITSET(0,31)
#DEFINE HKEY_CURRENT_USER -2147483647 && BITSET(0,31)+1
#DEFINE HKEY_LOCAL_MACHINE -2147483646 && BITSET(0,31)+2
#DEFINE HKEY_USERS -2147483645 && BITSET(0,31)+3

csys="System"

windir=GETENV("windir")
sistemaop=GETENV("OS")
systemroot=GETENV("systemroot")

if upper(sistemaop)="WINDOWS_NT"
csys=csys+"32"
endif
drvodbc=windir+"\"+csys+"\MSORCL10.DLL"

SET CLASSLIB TO registry.vcx additive
oReg = CreateObject("registry")

if !oreg.iskey("SOFTWARE\ODBC\odbc.ini\dorisdq",HKEY_LOCAL_MACHINE)
oreg.openkey("SOFTWARE\ODBC\odbc.ini\dorisdq",HKEY_LOCAL_MACHINE,.t.)
oreg.SetRegKey("BufferSize","40000","SOFTWARE\ODBC\odbc.ini\dorisdq",HKEY_LOCAL_MACHINE)
oreg.SetRegKey("ConnectString","worm","SOFTWARE\ODBC\odbc.ini\dorisdq",HKEY_LOCAL_MACHINE)
oreg.SetRegKey("Description","Doris","SOFTWARE\ODBC\odbc.ini\dorisdq",HKEY_LOCAL_MACHINE)
oreg.SetRegKey("Driver",drvodbc,"SOFTWARE\ODBC\odbc.ini\dorisdq",HKEY_LOCAL_MACHINE)
oreg.SetRegKey("DSN","Doris","SOFTWARE\ODBC\odbc.ini\dorisdq",HKEY_LOCAL_MACHINE)
oreg.SetRegKey("PWD",chr(0),"SOFTWARE\ODBC\odbc.ini\dorisdq",HKEY_LOCAL_MACHINE)
oreg.SetRegKey("Remarks","0","SOFTWARE\ODBC\odbc.ini\dorisdq",HKEY_LOCAL_MACHINE)
oreg.SetRegKey("RowLimit","400","SOFTWARE\ODBC\odbc.ini\dorisdq",HKEY_LOCAL_MACHINE)
oreg.SetRegKey("SynonymColumns","1","SOFTWARE\ODBC\odbc.ini\dorisdq",HKEY_LOCAL_MACHINE)
oreg.SetRegKey("SystemTable","0","SOFTWARE\ODBC\odbc.ini\dorisdq",HKEY_LOCAL_MACHINE)
oreg.SetRegKey("UID","arcisadm","SOFTWARE\ODBC\odbc.ini\dorisdq",HKEY_LOCAL_MACHINE)
oreg.SetRegKey("Dorisdq","Microsoft ODBC for Oracle","SOFTWARE\ODBC\odbc.ini\ODBC Data Sources",HKEY_LOCAL_MACHINE)
Endif
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform