Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2006
    Posts
    2

    Question Unanswered: DSN Problem in application

    Set Cn = New ADODB.Connection
    Set Rs = New ADODB.Recordset

    Private Sub Form_Load()

    Set Cn = New ADODB.Connection
    cn.open "DSN=test"

    End Sub

    I used the above code for each form and it is working properly. But for this i have to intialise the 'user DSN' in data sources (ODBC) of Administrative tools - Control Panel manually for each system wherever i install the application. I used VB6 as front-end and MSAccess as Back-end.

    So please guide me in 'how to intialise the ODBC connection automatically while application installation' i.e. what code required.

  2. #2
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    Quote Originally Posted by ngreddy
    Set Cn = New ADODB.Connection
    Set Rs = New ADODB.Recordset

    Private Sub Form_Load()

    Set Cn = New ADODB.Connection
    cn.open "DSN=test"

    End Sub

    I used the above code for each form and it is working properly. But for this i have to intialise the 'user DSN' in data sources (ODBC) of Administrative tools - Control Panel manually for each system wherever i install the application. I used VB6 as front-end and MSAccess as Back-end.

    So please guide me in 'how to intialise the ODBC connection automatically while application installation' i.e. what code required.

    The idea is to supply a connection string to ADO, which contains all the information that you enter when you set up a DSN.

    This is also known as a DSN-less connection.

    Take a look at Carl Prothman's Connection String Site, or at this ADO Tutorial for ideas.
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •