ODBC--connection to 'dbSql' failed. ,library ,3151 -
04-14-2011
, 06:27 AM
I have sql server 2005 linked tables with access2007, periodically
assigning a recordsource fails (see below) with
ODBC--connection to 'dbSql' failed. ,library ,3151
- No current record. ,DAO.Recordset ,3021
dbSql is an ODBC datasource
if I paste the sql server into a query, it returns one row of data
is my assumption that error 3151 indicates a network connectivity
issue valid ?
would a dsn-less connection be more reliable ?
strSql = "SELECT DISTINCT a.businessId" & _
" , a.name" & _
" , a.address" & _
" , a.city" & _
" , a.province" & _
" , a.postal" & _
" , a.phone" & _
" , a.fax" & _
" , a.baanCustomer" & _
" , a.baanPostalId" & _
" , a.baanDeliveryId" & _
" , a.baanSupplier" & _
" , c.fullName" & _
" , c.contactId" & _
" , a.parentBusinessId" & _
" , iif(a.inactive, false, true) as active" & _
" , iif(c.inactive, false, true) as activeContact" &
_
" FROM (tblBusiness as a LEFT JOIN" & _
" tblBusinessClass as b ON a.businessClassId =
b.businessClassId) LEFT JOIN" & _
" tblContact as c ON a.businessId =
c.businessId" & _
" WHERE " & strSql & _
" ORDER BY a.baanCustomer, a.baanSupplier,
a.baanPostalId, a.baanDeliveryId"
Me.RecordSource = strSql |