Unable to connect sql to ms access....

Hi Experts
(this is a follow up question to: http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_28232414.html)

And once again sorry/apologies if this is not the correct method of posting questions on the EE board. Sorry!!! if i have borken any rules.


I am having a nightmare trying to establish a connection to ms access via sql on a odbcad32.exc...

i have tried using the following vba to change the connection string and no luck for two days...

Public Function GetQueryLinks()
On Error GoTo Err_GetQueryLinks

    'Dim StrConn As ADODB.Connection
    'Set StrConn = New ADODB.Connection
    
    Dim qdf As DAO.QueryDef
    Dim StrConn As String
    
     StrConn = "ODBC;Driver=(Apples_Oranges);SERVER=SQAAPB3SBCA65130.global.Hire.com;Database=Apples_Oranges);;Port=12351;"
    
     
     For Each qdf In CurrentDb.QueryDefs
        If qdf.Connect <> "" Then

            qdf.Connect = StrConn
            Debug.Print qdf.Connect

        End If

        Next
            
Exit_GetQueryLinks:
    Set qdf = Nothing
    Exit Function

Err_GetQueryLinks:
    MsgBox Err.Number & " (" & Err.Description & ") in procedure GetQueryLinks of Module basTableLinks"
    Resume Exit_GetQueryLinks

End Function

Open in new window

route217JuniorAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ZberteocCommented:
0
route217JuniorAuthor Commented:
thanks for the feedback..

what about the other way around access to sql..
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
route217JuniorAuthor Commented:
hi expert...
thanks for the feedback but this is connecting sql to access...whats the reverse cod2...

I am  new to this...how do u connect access to sql...my initial vba is attached. .
0
ZberteocCommented:
My second message gives links about how to connect to SQL server, from any application, Access included.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.