Solved

The Field is too small to accept amount of data

Posted on 2004-10-13
7
247 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

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

863 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now