Link to home
Start Free TrialLog in
Avatar of Tom Knowlton
Tom KnowltonFlag for United States of America

asked on

Data source name not found and no default driver specified

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified




I get the error message above in the function call below:




Function fnGenHomebuyerList(strTempDate As String, strTempLenderFax As String, strTempLO As String) As String
    Dim db As New ADODB.Connection
    Dim recTemp As New ADODB.Recordset
       
    Dim intRecCount As Integer
    Dim strToField As String
    Dim strSubject As String
    Dim strFaxPath As String
    Dim fGoes As Boolean
    Dim strLOFaxDoc As String
    Dim strTempInText As String
    Dim strFaxRaw As String
    Dim strTempFieldName As String
    Dim FBoldSetting As Boolean
    Dim FItalicSetting As Boolean
    Dim FUnderlineSetting As Boolean
    Dim intFontSize As Integer
    Dim intBookmarkCount As Integer
    Dim strHomebuyerInfoLine As String
   
           
    recTemp.CursorLocation = adUseClient







    'ERROR MESSAGE WHEN THIS LINE RUNS
    db.Open "ODBC;DSN=Pipeline;Database=Pipeline"










   
    recTemp.Open "LOFaxSelect '" & strTempDate & "'", db, adOpenKeyset
   
    intRecCount = recTemp.RecordCount
   
    strHomebuyerInfoLine = "Homebuyer's Name=Neighborhood Gold Grant #=Tentative Closing Date" & Chr(10)
   
        If intRecCount > 0 Then
   
            Dim objWord1 As New Word.Application
   
            Do While recTemp.EOF = False
   
                strLOFaxDoc = "P:\Documents\fmLOFax.dot"
               
                If (Nz(recTemp("LenderFax"), "") = strTempLenderFax) And (Nz(recTemp("LO"), "") = strTempLO) Then
                    strHomebuyerInfoLine = strHomebuyerInfoLine & recTemp("HomeBuyer") & "=" & recTemp("entryID") & "=" & recTemp("tcd") & Chr(10)
                    fnAppendComment recTemp("entryID"), "LOFax", "LO fax sent"
                End If
                               
                DoEvents
               
                recTemp.MoveNext
           
            Loop
   
        End If
   
    recTemp.Close
   
    db.Close
   
    Set recTemp = Nothing
    Set db = Nothing
   
    fnGenHomebuyerList = strHomebuyerInfoLine

End Function
Avatar of Tom Knowlton
Tom Knowlton
Flag of United States of America image

ASKER

Things we have checked so far:

1)  In the Access client we can open links to tables on SQL Server and can read the info just fine.

2)  We opened ODBC Data Sources.  The DSN called "Pipline" is a System DSN, and the TEST works just fine.  Spelling is correct on the DSN.
Avatar of Smilesxl
Smilesxl

Did you Register the Database. This will enter the connection information for an ODBC data source in the Windows Registry. The ODBC driver needs connection information when the ODBC data source is opened during a session.  Look up Register Database in MS Access Help.

We fixed the problem in the interim (since I posted the question)

The fix was to remove ODBC from the connection string.

From this:

 db.Open "ODBC;DSN=Pipeline;Database=Pipeline"

To this:

 db.Open "DSN=Pipeline;Database=Pipeline"



Go figure  :)

My thinking is ODBC should still be valid.

Hi knowlton,

Please ask Community Support:
https://www.experts-exchange.com/Community_Support/
by means of a zero points Q to refund your points and to PAQ this question so others might benefit from your solution !

Thanks !

Nic;o)
Will do.

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of modulo
modulo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial