Solved

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

Posted on 2004-09-16
3
649 Views
Last Modified: 2013-11-14
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
Comment
Question by:abu_alahsan
  • 2
3 Comments
 
LVL 7

Expert Comment

by:_agj_
ID: 12081942
0
 
LVL 7

Expert Comment

by:_agj_
ID: 12081957
0
 
LVL 3

Accepted Solution

by:
sgayatri earned 500 total points
ID: 12082472
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now