Solved

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

Posted on 2004-09-16
3
661 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
If you don't know how to downgrade, my instructions below should be helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

809 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