?
Solved

Searching empty string in the database

Posted on 1998-08-04
2
Medium Priority
?
203 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Introducing Priority Question

Increase expert visibility of your issues by participating in Priority Question, our latest feature for Premium and Team Account holders. Adjust the priority of your question to get emergent issues in front of subject-matter experts for help when you need it most.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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…
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…
Suggested Courses

770 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