PB DataDirect ODBC 등록방법PB DataDirect ODBC 등록방법
Posted at 2010. 10. 3. 18:06 | Posted in PowerBuilder반응형
DIRECT ODBC를 이용하는 방법입니다.
--> 레지스트리 등록
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC Data Sources", "ODBC_TEST", "PB DATADIRECT OEM 4.20 Oracle Wire Protocol")
// Intersolv ODBC Registry Set
If RegistryGet("HKEY_LOCAL_MACHINE\Software\ODBC\ODBCINST.INI\ODBC Drivers", "PB DATADIRECT OEM 4.20 Oracle Wire Protocol", ls_Tmp) = -1 Then
li_SetOK += RegistrySet("HKEY_LOCAL_MACHINE\Software\ODBC\ODBCINST.INI\ODBC Drivers", "PB DATADIRECT OEM 4.20 Oracle Wire Protocol", "Installed")
li_SetOK += RegistrySet("HKEY_LOCAL_MACHINE\Software\ODBC\ODBCINST.INI\PB DATADIRECT OEM 4.20 Oracle Wire Protocol", "APILevel" , "1")
li_SetOK += RegistrySet("HKEY_LOCAL_MACHINE\Software\ODBC\ODBCINST.INI\PB DATADIRECT OEM 4.20 Oracle Wire Protocol", "ConnectFunctions", "YYY")
li_SetOK += RegistrySet("HKEY_LOCAL_MACHINE\Software\ODBC\ODBCINST.INI\PB DATADIRECT OEM 4.20 Oracle Wire Protocol", "CPTimeout" , "60")
li_SetOK += RegistrySet("HKEY_LOCAL_MACHINE\Software\ODBC\ODBCINST.INI\PB DATADIRECT OEM 4.20 Oracle Wire Protocol", "Driver" , SYS.WINDOWSDIR + "\pbora19.dll")
li_SetOK += RegistrySet("HKEY_LOCAL_MACHINE\Software\ODBC\ODBCINST.INI\PB DATADIRECT OEM 4.20 Oracle Wire Protocol", "DriverODBCVer" , "3.52")
li_SetOK += RegistrySet("HKEY_LOCAL_MACHINE\Software\ODBC\ODBCINST.INI\PB DATADIRECT OEM 4.20 Oracle Wire Protocol", "FileUsage" , "0")
li_SetOK += RegistrySet("HKEY_LOCAL_MACHINE\Software\ODBC\ODBCINST.INI\PB DATADIRECT OEM 4.20 Oracle Wire Protocol", "Setup" , SYS.WINDOWSDIR + "\pbora19s.dll")
li_SetOK += RegistrySet("HKEY_LOCAL_MACHINE\Software\ODBC\ODBCINST.INI\PB DATADIRECT OEM 4.20 Oracle Wire Protocol", "SQLLevel" , "1")
li_SetOK += RegistrySet("HKEY_LOCAL_MACHINE\Software\ODBC\ODBCINST.INI\PB DATADIRECT OEM 4.20 Oracle Wire Protocol", "UsageCount" , "1")
End If
// Intersolv ODBC(PB) SharedDLL Registry Set
li_SetOK += RegistrySet("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\SharedDLLs", SYS.WINDOWSDIR + "\PBORA19.DLL" ,ReguLong!, 2)
li_SetOK += RegistrySet("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\SharedDLLs", SYS.WINDOWSDIR + "\PBORA19S.DLL" ,ReguLong!, 2)
li_SetOK += RegistrySet("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\SharedDLLs", SYS.WINDOWSDIR + "\PBBAS19.DLL" ,ReguLong!, 2)
li_SetOK += RegistrySet("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\SharedDLLs", SYS.WINDOWSDIR + "\PBUTL19.DLL" ,ReguLong!, 2)
li_SetOK += RegistrySet("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\SharedDLLs", SYS.WINDOWSDIR + "\PBUTL19R.DLL" ,ReguLong!, 2)
li_SetOK += RegistrySet("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\SharedDLLs", SYS.WINDOWSDIR + "\IVPB.LIC" ,ReguLong!, 2)
li_SetOK += RegistrySet("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\SharedDLLs", SYS.WINDOWSDIR + "\PBODB100.DLL" ,ReguLong!, 2)
// ODBC.INI Set
SetProfileString(SYS.WINDOWSDIR + "\ODBC.INI", "ODBC 32 bit Data Sources" , "ODBC_TEST", "PB DATADIRECT OEM 4.20 Oracle Wire Protocol")
SetProfileString(SYS.WINDOWSDIR + "\ODBC.INI", "ODBC_TEST" , "Driver32", SYS.WINDOWSDIR + "\PBORA19.DLL")
// ODBC_TEST ODBC Configure
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "ApplicationUsingThreads" , "1" )
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "ArraySize" , "60000" )
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "CachedCursorLimit" , "32")
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "CachedDescLimit" , "1" )
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "CatalogIncludesSynonyms" , "1" )
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "CatalogOptions" , "0")
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "DefaultLongDataBuffLen" , "8192" )
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "DescribeAtPrepare" , "1" )
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "Description" , "ODBC_TEST")
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "Driver" , SYS.WINDOWSDIR + "\PBORA19.DLL")
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "EnableDescribeParam" , "0" )
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "EnableNcharSupport" , "1" )
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "EnableScrollableCursors" , "1" )
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "EnableStaticCursorsForLongData", "1")
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "EnableTimestampWithTimeZone" , "1" )
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "HostName" , "")
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "LocalTimeZoneOffset" , "")
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "LockTimeOut" , "-1")
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "LogonID" , "")
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "PortNumber" , "")
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "ProcedureRetResults" , "1" )
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "SID" , "")
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "UseCurrentSchema" , "1")
이렇게 하면 ODBC_TEST 이라는 ODBC가 생성됩니다.
관련 화일은 위 구문에 보시면 몇개 안됩니다..
그걸 찾으시면 됩니다..
CONNECT 시에는
SQLCA.DBMS = "ODBC" // ODBC
SQLCA.DBPARM = "ConnectString='DSN=ODBC_TEST;HOST="+ls_ipaddress+";PORT="+ls_port+";SID="+ls_sid+";UID="+ls_logid+";PWD="+ls_logpass+"',CommitonDisconnect='No'"
SQLCA.AUTOCOMMIT = FALSE
로 하시면 됩니다.
단, 단점은 Oracle SP를 sqlca transaction에 등록 후 사용하셔야 합니다.
--> 레지스트리 등록
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC Data Sources", "ODBC_TEST", "PB DATADIRECT OEM 4.20 Oracle Wire Protocol")
// Intersolv ODBC Registry Set
If RegistryGet("HKEY_LOCAL_MACHINE\Software\ODBC\ODBCINST.INI\ODBC Drivers", "PB DATADIRECT OEM 4.20 Oracle Wire Protocol", ls_Tmp) = -1 Then
li_SetOK += RegistrySet("HKEY_LOCAL_MACHINE\Software\ODBC\ODBCINST.INI\ODBC Drivers", "PB DATADIRECT OEM 4.20 Oracle Wire Protocol", "Installed")
li_SetOK += RegistrySet("HKEY_LOCAL_MACHINE\Software\ODBC\ODBCINST.INI\PB DATADIRECT OEM 4.20 Oracle Wire Protocol", "APILevel" , "1")
li_SetOK += RegistrySet("HKEY_LOCAL_MACHINE\Software\ODBC\ODBCINST.INI\PB DATADIRECT OEM 4.20 Oracle Wire Protocol", "ConnectFunctions", "YYY")
li_SetOK += RegistrySet("HKEY_LOCAL_MACHINE\Software\ODBC\ODBCINST.INI\PB DATADIRECT OEM 4.20 Oracle Wire Protocol", "CPTimeout" , "60")
li_SetOK += RegistrySet("HKEY_LOCAL_MACHINE\Software\ODBC\ODBCINST.INI\PB DATADIRECT OEM 4.20 Oracle Wire Protocol", "Driver" , SYS.WINDOWSDIR + "\pbora19.dll")
li_SetOK += RegistrySet("HKEY_LOCAL_MACHINE\Software\ODBC\ODBCINST.INI\PB DATADIRECT OEM 4.20 Oracle Wire Protocol", "DriverODBCVer" , "3.52")
li_SetOK += RegistrySet("HKEY_LOCAL_MACHINE\Software\ODBC\ODBCINST.INI\PB DATADIRECT OEM 4.20 Oracle Wire Protocol", "FileUsage" , "0")
li_SetOK += RegistrySet("HKEY_LOCAL_MACHINE\Software\ODBC\ODBCINST.INI\PB DATADIRECT OEM 4.20 Oracle Wire Protocol", "Setup" , SYS.WINDOWSDIR + "\pbora19s.dll")
li_SetOK += RegistrySet("HKEY_LOCAL_MACHINE\Software\ODBC\ODBCINST.INI\PB DATADIRECT OEM 4.20 Oracle Wire Protocol", "SQLLevel" , "1")
li_SetOK += RegistrySet("HKEY_LOCAL_MACHINE\Software\ODBC\ODBCINST.INI\PB DATADIRECT OEM 4.20 Oracle Wire Protocol", "UsageCount" , "1")
End If
// Intersolv ODBC(PB) SharedDLL Registry Set
li_SetOK += RegistrySet("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\SharedDLLs", SYS.WINDOWSDIR + "\PBORA19.DLL" ,ReguLong!, 2)
li_SetOK += RegistrySet("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\SharedDLLs", SYS.WINDOWSDIR + "\PBORA19S.DLL" ,ReguLong!, 2)
li_SetOK += RegistrySet("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\SharedDLLs", SYS.WINDOWSDIR + "\PBBAS19.DLL" ,ReguLong!, 2)
li_SetOK += RegistrySet("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\SharedDLLs", SYS.WINDOWSDIR + "\PBUTL19.DLL" ,ReguLong!, 2)
li_SetOK += RegistrySet("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\SharedDLLs", SYS.WINDOWSDIR + "\PBUTL19R.DLL" ,ReguLong!, 2)
li_SetOK += RegistrySet("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\SharedDLLs", SYS.WINDOWSDIR + "\IVPB.LIC" ,ReguLong!, 2)
li_SetOK += RegistrySet("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\SharedDLLs", SYS.WINDOWSDIR + "\PBODB100.DLL" ,ReguLong!, 2)
// ODBC.INI Set
SetProfileString(SYS.WINDOWSDIR + "\ODBC.INI", "ODBC 32 bit Data Sources" , "ODBC_TEST", "PB DATADIRECT OEM 4.20 Oracle Wire Protocol")
SetProfileString(SYS.WINDOWSDIR + "\ODBC.INI", "ODBC_TEST" , "Driver32", SYS.WINDOWSDIR + "\PBORA19.DLL")
// ODBC_TEST ODBC Configure
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "ApplicationUsingThreads" , "1" )
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "ArraySize" , "60000" )
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "CachedCursorLimit" , "32")
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "CachedDescLimit" , "1" )
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "CatalogIncludesSynonyms" , "1" )
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "CatalogOptions" , "0")
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "DefaultLongDataBuffLen" , "8192" )
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "DescribeAtPrepare" , "1" )
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "Description" , "ODBC_TEST")
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "Driver" , SYS.WINDOWSDIR + "\PBORA19.DLL")
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "EnableDescribeParam" , "0" )
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "EnableNcharSupport" , "1" )
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "EnableScrollableCursors" , "1" )
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "EnableStaticCursorsForLongData", "1")
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "EnableTimestampWithTimeZone" , "1" )
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "HostName" , "")
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "LocalTimeZoneOffset" , "")
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "LockTimeOut" , "-1")
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "LogonID" , "")
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "PortNumber" , "")
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "ProcedureRetResults" , "1" )
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "SID" , "")
li_SetOK += RegistrySet("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC_TEST", "UseCurrentSchema" , "1")
이렇게 하면 ODBC_TEST 이라는 ODBC가 생성됩니다.
관련 화일은 위 구문에 보시면 몇개 안됩니다..
그걸 찾으시면 됩니다..
CONNECT 시에는
SQLCA.DBMS = "ODBC" // ODBC
SQLCA.DBPARM = "ConnectString='DSN=ODBC_TEST;HOST="+ls_ipaddress+";PORT="+ls_port+";SID="+ls_sid+";UID="+ls_logid+";PWD="+ls_logpass+"',CommitonDisconnect='No'"
SQLCA.AUTOCOMMIT = FALSE
로 하시면 됩니다.
단, 단점은 Oracle SP를 sqlca transaction에 등록 후 사용하셔야 합니다.
반응형
'PowerBuilder' 카테고리의 다른 글
2개 이상의 디비 접속 (0) | 2010.10.08 |
---|---|
ORACLE(PL-SQL) 초급 매뉴얼 (0) | 2010.10.08 |
PowerBuilder 컴퓨터 환경 읽어오기 (0) | 2010.10.08 |
간단히 현재 실행 중인 경로 알아오기 [출처] [초보] 간단히 현재 실행 중인 경로 알아오기. (0) | 2010.10.08 |
파워빌더에서 화면 캡처하기 (0) | 2010.10.03 |