Solved

Searching empty string in the database

Posted on 1998-08-04
2
200 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

792 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