By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,963 Members | 1,238 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,963 IT Pros & Developers. It's quick & easy.

get MSDASC.DataLinks COM Object used CreateObject function in VB or PB

P: n/a
------------------------------------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

Feb 28 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.