Solved

The Field is too small to accept amount of data

Posted on 2004-10-13
7
263 Views
Last Modified: 2006-11-17
I have an Access97 frontend with an SQL backend. The following code generates the error "The Field is too small to accept amount of data try...." Why? I am not adding or inserting. I am just searching. Why?


Dim db As Database
Dim StrCriteria  As String
Dim CustomersRS As Recordset

        Set db = CurrentDb()
        Set CustomersRS = db.OpenRecordset("Customers", dbOpenDynaset)
        StrCriteria = "[ReminderDate] = #1/1/04#"
        CustomersRS.FindFirst StrCriteria

Thanks, Ira
0
Comment
Question by:QuickQuote
  • 2
  • 2
7 Comments
 
LVL 9

Expert Comment

by:paelo
ID: 12304788
SQL does use different delimiters for date values but I can never remember how Access handles them, especially Acc97.  Try using "[ReminderDate]='1/1/04'.  You also might want to consider moving to the ADO recordset object rather than DAO when working with SQL server.

-Paul.
0
 

Author Comment

by:QuickQuote
ID: 12304834
Tried that too. Same error. It's just a find. Why the error?
0
 
LVL 9

Expert Comment

by:paelo
ID: 12305065
I'm not familiar with the particular error, but maybe its an old bug with the DAO library.  You could try to check your references and update to the DAO 3.6 library if possible.  
0
 
LVL 3

Accepted Solution

by:
StuartSanders earned 500 total points
ID: 12307652
You could try using the numerical value

StrCriteria = "[ReminderDate] = " & cstr(clng(datevalue("1/1/04")))

or alternatively open the recordset with the critieria

        Set db = CurrentDb()
        StrCriteria = "[ReminderDate] = #1/1/04#"
        Set CustomersRS = db.OpenRecordset("SELECT Customers.* FROM Customers WHERE " & StrCriteria, dbOpenDynaset)

        if not CustomersRS.eof then
       ' do stuff
             
Stuart
0
 

Author Comment

by:QuickQuote
ID: 12307653
Just tried the new 3.6 library...same error.
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question