Solved

Searching empty string in the database

Posted on 1998-08-04
2
196 Views
Last Modified: 2010-05-03
I am checking  all the database tables fields for empty string. I used
"do loop " statement go to each table and check  each field  FOR empty string  .It works but it seems so slow especially with large amount of data.
So is there any way of doing it? Like using any API FUNCTION???
0
Comment
Question by:ozlem
2 Comments
 
LVL 7

Expert Comment

by:tward
ID: 1467725
Posting some code may help to determine if/where there is a slow point.
0
 

Accepted Solution

by:
jaimereed earned 20 total points
ID: 1467726
Try creating a new recordset from the database using an SQL statement that only selects records with an empty string (note you can't use the * in criteria so you have to separately specify the field names). E.g.

set rs = theDb.OpenRecordSet("SELECT * FROM [your table] WHERE ( ( [Field1] = NULL)  OR ( [Field2]= NULL ) OR ... )"

You can then do whatever you want with the entire returned recordset. Note that this may not work if you have explicity told the database to use empty-strings rather than NULLs. If this is the case replace NULL with ''. MS Access/VB default to using NULLS (which is faster).
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

757 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

19 Experts available now in Live!

Get 1:1 Help Now