Hello Brad,

you wrote : 
> Here's a snippet from the Connections.cls class module in the
> SQLStudioDBLayer project.
 (...)
> '  5. call oconman.getconnection(autoCommit,....,ocon)
 (...)
> I've tried to follow this, but I'm having some trouble.
> 
> I've got:
> 
> References: DSQLControl, SQLStudioDBLayer
> 
> In the declarations section of a VB form:
> 
> Dim oConMan As Connections
> Dim oCon As connection
> 
> In the Form_Load event
> 
>     Set oConMan = New Connections
>     set oCon = New connection
> 
> I get an error on this line at compile time - "Invalid use of 
> New keyword"
> my copy of SQLStudioDBLayer has connection.cls as public not creatable
> shouldn't it be multi-use?

'Connections.getConnection' is (sort of) a factory method
which sets its 'Connection' parameter reference to a valid
'Connection' instance. This is (intentionally) the only legal way to get 
a 'Connection'instance from the pool.

>     oConMan.dataBase = "TST"
>     oConMan.dbServer = "win2k"
>     oConMan.hWnd = Me.hWnd
>     oConMan.pwd = "dba"
>     oConMan.uid = "dba"
>     oConMan.driver = "SAP DB DRIVER"
>     oConMan.driverIsoLevel = Committed
>     oConMan.driverSQLMode = Internal
>     oConMan.poolingMode = WA_DBC_SHARED
> 
>     If oConMan.getConnection(Committed, Internal, 
> AutoCommitOn, oCon) Then
>         MsgBox "connected"
>     Else
>         MsgBox "not connected - " & oCon.Error.Text
>     End If
> 
> when I remove the Set oCon = new connection, it runs ok, but 
> then I get the
> "not connected" messagebox and an error frm the oCon object of "Cancel
> Pressed"    !!!!!---

we tried your test case and it worked until we removed (e.g.) 'wapi.dll'
from the project directory; then we saw the "Cancel Pressed" 
(yes, that's misleading) thing. 
make sure that all of the SQL studio 'runtime' stuff (from its installdir)
is present. You can simply copy these dlls to your project dir, 
no registration needed.
if the problem persists mail again.

regards

Markus Stausberg
SAP Labs Berlin
 
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to