dbTalk Databases Forums  

Return to brOpenConnect

comp.databases.pick comp.databases.pick


Discuss Return to brOpenConnect in the comp.databases.pick forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
soumi0@walla.com
 
Posts: n/a

Default Return to brOpenConnect - 10-19-2006 , 08:23 AM






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


Reply With Quote
  #2  
Old   
Mark Brown
 
Posts: n/a

Default Re: Return to brOpenConnect - 10-19-2006 , 09:08 AM






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.

Mark Brown

<soumi0 (AT) walla (DOT) com> wrote

Quote:
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




Reply With Quote
  #3  
Old   
soumi0@walla.com
 
Posts: n/a

Default Re: Return to brOpenConnect - 10-20-2006 , 04:14 AM



Quote:
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.
Access to remote host with using DCOM (References D3VB4Tst.exe) Okey
Sub Macro()
Dim oEnv As clsD3Environment
Dim oConn As clsD3Connection
Set oEnv = CreateObject("D3VB4Tst.clsD3Environment", "remote_host")
Set oConn = oEnv.brOpenConnection("", "dm") <----Ok

Access to local host with using DCOM(References D3OleSrv.dll) Okey
Sub Macro()
Dim oEnv As clsD3Environment
Dim oConn As clsD3Connection
Set oEnv = CreateObject("D3OleSrv.clsD3Environment")
Set oConn = oEnv.brOpenConnection("", "dm") <--- Ok


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



Reply With Quote
  #4  
Old   
soumi0@walla.com
 
Posts: n/a

Default Re: Return to brOpenConnect - 10-20-2006 , 04:20 AM



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


Reply With Quote
  #5  
Old   
Kevin Powick
 
Posts: n/a

Default Re: Return to brOpenConnect - 10-20-2006 , 05:27 AM



soumi0 (AT) walla (DOT) com wrote:

Quote:
Set oEnv = CreateObject("D3OleSrv.clsD3Environment")
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.

Use View/Object Browser menu in Excel to examine this class library.

Quote:
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
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.

--
Kevin Powick



Reply With Quote
  #6  
Old   
soumi0@walla.com
 
Posts: n/a

Default Re: Return to brOpenConnect - 10-20-2006 , 08:21 AM




"Kevin Powick писал(а):
"

Quote:
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.
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

brOpenConnection Method Example

Sub Main()

Dim oEnv As New clsD3Environment
Dim oConn1 As clsD3Connection
Dim oConn2 As clsD3Connection
' Environment settings
oEnv.brCurrency = "$"
oEnv.brDecimal = "."
oEnv.brGrouping = ","
oEnv.brCasing = False

Set oConn1 = oEnv.brOpenConnection("ODBC", "USproduction")
Set oConn2 = oEnv.brOpenConnection("ODBC", "UKproduction")

' "USproduction" is USER_DSN or SYSDSN
....

' Closing connections
oEnv.brCloseConnection oConn1
oEnv.brCloseConnection oConn2
Set oEnv = Nothing
End Sub



Reply With Quote
  #7  
Old   
Mark Brown
 
Posts: n/a

Default Re: Return to brOpenConnect - 10-20-2006 , 10:09 AM



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.

Mark Brown


<soumi0 (AT) walla (DOT) com> wrote

Quote:
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




Reply With Quote
  #8  
Old   
Kevin Powick
 
Posts: n/a

Default Re: Return to brOpenConnect - 10-20-2006 , 10:09 AM



soumi0 (AT) walla (DOT) com wrote:

Quote:
I agree for local access, but for remote machine i use
Tools/References menu in Excel to select the D3CLODBC(only) Library.
Why? I use D3OleSvr to connect to remote hosts all the time. 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.

Use the D3OleSvr whenever you can.

Quote:
Next sample from D3Books OnLine
D3Books OnLine are terrible. The fact that they reference VB4 should
indicate how old they are.

Unless they have been updated recently, the information is often
missing or inaccurate.

--
Kevin Powick



Reply With Quote
  #9  
Old   
soumi0@walla.com
 
Posts: n/a

Default Re: Return to brOpenConnect - 10-21-2006 , 01:06 PM




Quote:
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.
I wrote(formulate) wrongly in my question,
e.g. brOpenConn("ODBC","DM") where "DM" is SYS_DSN or USER_DSN.
When I run brOpenConn , remote host registered my access as new (next)
pibs, but VB returned error.Pibs records is empty.
My second question.Can I "shutdown" counter pibs?
Example: I have 2 log users.Pibs 2 and 3.After my 5 try exec wrongly
macros, log in next user .
System assignment pibs 8.I want after exec macros "returned counter"
pibs on 3.In that case next log in user will get 4 pibs
Thanks



Reply With Quote
  #10  
Old   
soumi0@walla.com
 
Posts: n/a

Default Re: Return to brOpenConnect - 10-21-2006 , 01:56 PM




Quote:
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.
Please get me example your HKEY to group or soumi (AT) walla (DOT) com

Quote:
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
or Query acros
DSN with ODBC.This is obsolescence?
Thanks



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.