get MSDASC.DataLinks COM Object used CreateObject function in VB or PB
- From: cui_y_x2002@xxxxxxxxxxxx
- Date: 27 Feb 2006 22:45:29 -0800
------------------------------------in
VB------------------------------------------------------------------
Dim oDataLink As Object 'MSDASC.DataLinks
Dim oCon As Object 'ADODB.Connection
On Error Resume Next
Set oDataLink = CreateObject("DataLinks")
If oDataLink Is Nothing = False Then
Set oCon = CreateObject("ADODB.Connection")
'Create new Link
Call oDataLink.PromptEdit(oCon)
'Modify Link
' oCon=oDataLink.PromptNew()
OLEDBConnectionStringCreate = oCon.ConnectionString
Else
Debug.Print Err.Description
Debug.Assert False
End If
Set oCon = Nothing
Set oDataLink = Nothing
----------------------------------------------in
PowerBuilder-----------------------------------
OLEObject DataLink
OLEObject ADOConnection
DataLink=create OLEObject
ADOConnection=create OLEObject
try
DataLink.ConnectToNewObject("DataLinks")
ADOConnection.ConnectToNewObject("ADODB.Connection")
ADOConnection=DataLink.PromptNew()
// edit connection string
//DataLink.PromptEdit(ADOConnection)
finally
DataLink.DisconnectObject()
ADOConnection.DisconnectObject()
Destroy DataLink
Destroy ADOConnection
end try
.
- Prev by Date: Re: From text box to field
- Next by Date: Re: Who started me?
- Previous by thread: From text box to field
- Next by thread: Userform as subform
- Index(es):