[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 688
  • Last Modified:

How to Configure User DSN (ODBC) on Client side Automaticallyonnection

I am using Remote Data Control in VB application and using user DSN for ODBC connection. I am using InstallShield to prepare Setup. I want to Configure ODBC on client side automatical through InstallShield or VB Code whichever is best. I have tried to set DSN in Installshield and it creates User DSN on Client side but It does not attach Database automatically for which I have to educate Client which i don't want to.
I need solution, ODBC file DSN can help me but how to set RdoConnect?

Ahmad Nawaz
0
abu_alahsan
Asked:
abu_alahsan
  • 2
1 Solution
 
_agj_Commented:
0
 
sgayatriCommented:
This is the way you can do from vb

Add 'ODBC driver & Datasource name functions'
 from project >> references to your project


Dim datasn As New Dsn
Dim str1 As String
Dim str2() As String
Dim con_string As String
con_string = "orcl"  ''' this is the database alias created thru net easy configuration on client side
On Error GoTo errhand
''''''    ***********************************************************
''''''    Data Source Name Creation                                 '
''''''    ***********************************************************
    str1 = datasn.GetOdbcDriverList(str2())
    For i = 0 To UBound(str2()) 'if the driver is existing then only create imagebase
        If str2(i) = "Microsoft ODBC for Oracle" Then    'Here replace the string which you want to create
               str1 = datasn.CreateDSN("fms", "Microsoft ODBC for Oracle", con_string, "", "society", "", "", True, "") ''' ODBC driver for sqlnet 7.3

'''here con_String is the database alias created on client side
''' society is the username in the database
           
           If str1 = False Then
                MsgBox "Unable to Create ODBC Data Source Name " + vbCrLf + " Check whether MSORCL32.dll file is Existing in C:\WINDOWS\SYSTEM directory!" + vbCrLf + "If Not Copy the file from other client and Register it Using REGSVR32!", vbInformation
           End If
           Exit Sub
        End If
    Next
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now