ODBC ----Connection to 'MyServer' failed

Posted on 2012-08-30
Last Modified: 2012-08-31
I have created a DSN Connection
and Through MS Access linked SQL table successfully.
Directly i can access using my username and password.
But through my VB Code, Getting RunTime Error..
"ODBC ----Connection to 'MyServer' failed"

and highlighted on following line.

  Set rs = Con.Execute("SELECT * FROM [ODBC;DSN=MyServer;uid=*******;pwd=*******;database=CustRecDtl].DBO_Cust_Dtl")
Question by:crystal_Tech
    LVL 4

    Accepted Solution

    Con = New Odbc.OdbcConnection("DSN=MyServer")
    rs = New Odbc.OdbcDataAdapter("SELECT * FROM DBO_Cust_Dtl;", Con)
    LVL 1

    Author Comment

    ok what i did is.. removed DSN and recreated .. and problem solved..


    Featured Post

    Courses: Start Training Online With Pros, Today

    Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

    Join & Write a Comment

    Creating an OSPF network that automatically (dynamically) reroutes network traffic over other connections to prevent network downtime.
    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…
    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…

    755 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

    25 Experts available now in Live!

    Get 1:1 Help Now