RE: SQL Server Error

From: LeAnn (LeAnn_at_discussions.microsoft.com)
Date: 12/21/04


Date: Tue, 21 Dec 2004 14:59:03 -0800

Some additional information that might be helpful:

SQL 2000 Server
It is an Access 97 database
The vba function has the following code:

Set conn = New ADODB.Connection
With conn
    .ConnectionString = "DSN=SQLBSLDB_NT"
    .Open
End With
Set res = New ADODB.Recordset
Set res.ActiveConnection = conn
res.CursorLocation = adUseClient

varSQL = "SELECT UNIT_ID, CONTRACT_ID, DATE,'CITY A'AS LOCATION FROM
UNITS_TP_INT " _
& "WHERE UNIT_ID BETWEEN " & sngSStart & " AND " & sngSEnd _
& " UNION ALL SELECT UNIT_ID, CONTRACT_ID, DATE, 'City B' AS LOCATION FROM
UNITS_BD_INT " _
& "WHERE UNIT_ID BETWEEN " & sngSStart & " AND " & sngSEnd & " ORDER BY
LOCATION, UNIT_ID"

res.Open varSQL, , adOpenKeyset (this is where the error occurs)

"LeAnn" wrote:

> I have an access database that has a process that checks against data in a
> SQL server. I'm getting the following error when I click the button that
> verifies whether a certain range is in the SQL database:
>
> Error # 2147217833 Description:[Microsoft][ODBC SQL Server Driver][SQL
> Server]The conversion of the varchar value '095604029004' overflowed an int
> column. Maximum interger value exceeded.
>
> I did a search in the KB and it refers ADOFiltr.dll error message when
> calling the API functions DesktopToDevice or DeviceToDesktop. The access
> application does not call either of these function and from what I can tell
> doesn't call any API functions.
>
> On Monday our IT department changed all users network login ids. We are
> having other problems related to the change and was wondering if this error
> has anything to do with it. Do I need to re-create the ODBC driver for each
> user's workstation?
>
> Any assistance is greatly appreciated
>