dbTalk Databases Forums  

ODBC--connection to 'dbSql' failed. ,library ,3151

comp.databases.ms-access comp.databases.ms-access


Discuss ODBC--connection to 'dbSql' failed. ,library ,3151 in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Roger
 
Posts: n/a

Default 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

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.