![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi. I actually have problem. brOpenConnection method doesn't work in Excel VBApplication. I get msg error of -2147220223 "Unidentified Internal Error". DSN is working conditions. MSQuery returned well result Thanks |
#3
| |||
| |||
|
|
Make sure the object is DIM'ed as NEW clsD3Connection or use the SET to create a new instance of the object before you attempt to connect it. |
#4
| |||
| |||
|
#5
| |||
| |||
|
|
Set oEnv = CreateObject("D3OleSrv.clsD3Environment") |
|
Access to local host with using ODBC(References D3CLODBC.dll) ERROR Sub Macro() Dim aEnv As clsD3Environment Dim aCon As clsD3Connection Set aEnv = New clsD3Environment Set aCon = aEnv.brOpenConnection("ODBC", "DM") <--Error 2147220223 |
#6
| |||
| |||
|
|
Why are you using CreateObject()? This is late binding. If you have a reference to the D3 Class library (D3OleSrv), you should use early binding. Dim oEnv As clsD3Environment Dim oDomain As clsD3NetDomain Dim oDB As clsD3Database Dim oFile as clsD3File Set oEnv = New clsD3Environment Set oDomain = oEnv.brOpenDomain("") Set oDB = oDomain.brOpenDatabase(DBName) Set oFile = oDB.brOpenFile(FileName) Use Tools/References menu in Excel to select the D3Object Library in-process Server. I've never used the ODBC lib, but in your example, it appears that you are missing CreateObject() for the aEnv variable. However, as above, this is late binding. You're better off setting up a reference to the lib and using early binding. |
#7
| |||
| |||
|
|
Sorry, last group string for REMOTE HOST Access to REMOTE host with using ODBC(References D3CLODBC.dll) ERROR Sub Macro() Dim aEnv As clsD3Environment Dim aCon As clsD3Connection Set aEnv = New clsD3Environment Set aCon = aEnv.brOpenConnection("ODBC", "DM") <--Error 2147220223 |
#8
| |||
| |||
|
|
I agree for local access, but for remote machine i use Tools/References menu in Excel to select the D3CLODBC(only) Library. |
|
Next sample from D3Books OnLine |
#9
| |||
| |||
|
|
The parameters for brOpenConnection should be "ODBC", DSN_Name DSN_name is the name of the Data Source Name you defined to attach to the database. Usually NOT DM. Ok, Mark. |
#10
| |||
| |||
|
|
The only "trick" is setting the registry key "MdsServerName" to the IP address or hostname of the remote system. HKEY_LOCAL_MACHINE\SOFTWARE\PickSystems\D3\Current Version\D3FSI I actually wrote a simple utility to do the registry change for me when I want to connect to different hosts. |
|
Why use ODBC? It's slow and a terrible implementation in D3, forcing you to create duplicate files of your D3 data. Visual Componet Library (C++) present DSN where uses ODBC.I use Table |
![]() |
| Thread Tools | |
| Display Modes | |
| |