|
-
Aug 23rd, 2000, 09:43 AM
#1
Thread Starter
Addicted Member
Hello!
I'm developing a database related program and when a field that I wanna retrieve from DB is empty, it returns error 94 (Invalid use of null).
How can I avoid this error and retrieve data from database? Is it enough to write this statement before loading data from database:
Code:
On Error Resume Next
Zvonko
Zvonko Bostjancic
Ilirska Bistrica, Slovenia
[email protected]
Using VS6 Professional with SP3
Programming mostly in VB and I've started to learn VC++ & MFC
-
Aug 23rd, 2000, 09:53 AM
#2
Fanatic Member
If for example you were retrieving a field called Employee into a text box called txtEmployee then ...
Code:
txtEmployee.Text = "" & rs!Employee
The "" would stop any error due to Employee being empty.
VB6 sp5, SQL Server 2000, C#
There are no stupid questions. Only stupid people. 
-
Aug 23rd, 2000, 10:23 AM
#3
Frenzied Member
or you can
try
Code:
if NOT (rs!Employee) then txtEmployee.text = rs!Employee
-
Aug 23rd, 2000, 10:24 AM
#4
Frenzied Member
sowwy about last one
Code:
if NOT ISNULL(rs!Employee) then txtEmployee.text = rs!Employee
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|