Solved

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

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

786 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