473,327 Members | 1,919 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Checking for Null Database Values

i want to check if the following field is null.

Dim rsAssets As New ADODB.Recordset

rsAssets.Fields("SubIcon").Value)

IsNull is no longer supported, so what should I use?

Thanks

Vayse


Nov 21 '05 #1
7 1735
"Vayse" <Va***@nospam.nospam> wrote in message news:O%******************@TK2MSFTNGP14.phx.gbl...
i want to check if the following field is null.

Dim rsAssets As New ADODB.Recordset

rsAssets.Fields("SubIcon").Value)

IsNull is no longer supported, so what should I use?

Thanks

Vayse


Try IsDbNull().

--
Al Reid
Nov 21 '05 #2
Thats it, thanks.
"Al Reid" <ar*****@reidDASHhome.com> wrote in message
news:uy**************@tk2msftngp13.phx.gbl...
"Vayse" <Va***@nospam.nospam> wrote in message
news:O%******************@TK2MSFTNGP14.phx.gbl...
i want to check if the following field is null.

Dim rsAssets As New ADODB.Recordset

rsAssets.Fields("SubIcon").Value)

IsNull is no longer supported, so what should I use?

Thanks

Vayse


Try IsDbNull().

--
Al Reid

Nov 21 '05 #3
Convert.DBNull

"Vayse" <Va***@nospam.nospam> wrote in message
news:O%******************@TK2MSFTNGP14.phx.gbl...
i want to check if the following field is null.

Dim rsAssets As New ADODB.Recordset

rsAssets.Fields("SubIcon").Value)

IsNull is no longer supported, so what should I use?

Thanks

Vayse

Nov 21 '05 #4
Not quite. Convert.DBNull is a constant representing "database null" while Convert.IsDBNull() is the test for it.

--
Al Reid

"Pipo" <No****@me.com> wrote in message news:OA**************@TK2MSFTNGP14.phx.gbl...
Convert.DBNull

"Vayse" <Va***@nospam.nospam> wrote in message
news:O%******************@TK2MSFTNGP14.phx.gbl...
i want to check if the following field is null.

Dim rsAssets As New ADODB.Recordset

rsAssets.Fields("SubIcon").Value)

IsNull is no longer supported, so what should I use?

Thanks

Vayse


Nov 21 '05 #5
"Al Reid" <ar*****@reidDASHhome.com> schrieb:
Not quite. Convert.DBNull is a constant representing "database null"
while Convert.IsDBNull() is the test for it.


However, you could use 'If ... Is DBNull.Value Then...' instead of
'IsDBNull'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #6
if rsAssets.Fields("SubIcon") = convert.dbnull then

end if
"Al Reid" <ar*****@reidDASHhome.com> wrote in message
news:ep**************@TK2MSFTNGP09.phx.gbl...
Not quite. Convert.DBNull is a constant representing "database null" while Convert.IsDBNull() is the test for it.
--
Al Reid

"Pipo" <No****@me.com> wrote in message

news:OA**************@TK2MSFTNGP14.phx.gbl...
Convert.DBNull

"Vayse" <Va***@nospam.nospam> wrote in message
news:O%******************@TK2MSFTNGP14.phx.gbl...
i want to check if the following field is null.

Dim rsAssets As New ADODB.Recordset

rsAssets.Fields("SubIcon").Value)

IsNull is no longer supported, so what should I use?

Thanks

Vayse



Nov 21 '05 #7
Thanks Herfried,

That was what I meant.

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:OA**************@TK2MSFTNGP14.phx.gbl...
"Al Reid" <ar*****@reidDASHhome.com> schrieb:
Not quite. Convert.DBNull is a constant representing "database null"
while Convert.IsDBNull() is the test for it.


However, you could use 'If ... Is DBNull.Value Then...' instead of
'IsDBNull'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

26
by: Agoston Bejo | last post by:
I want to enforce such a constraint on a column that would ensure that the values be all unique, but this wouldn't apply to NULL values. (I.e. there may be more than one NULL value in the column.)...
30
by: Michael B Allen | last post by:
I have a general purpose library that has a lot of checks for bad input parameters like: void * linkedlist_get(struct linkedlist *l, unsigned int idx) { if (l == NULL) { errno = EINVAL;...
99
by: Mikhail Teterin | last post by:
Hello! Consider the following simple accessor function: typedef struct { int i; char name; } MY_TYPE; const char *
7
by: Dan | last post by:
I'm fairly new to C# and I am having some problems understanding int variables and null values. I have created a class that populates the values of it's fields from a DataReader in it's...
17
by: Mark A | last post by:
DB2 8.2 for Linux, FP 10 (also performs the same on DB2 8.2 for Windoes, FP 11). Using the SAMPLE database, tables EMP and EMLOYEE. In the followng stored procedure, 2 NULL columns (COMM) are...
3
by: Martyn Fewtrell | last post by:
Hi there. I wonder if there was a "correct answer" for Vb.Net (I understand this is quite easy in C#). If im drawing data from a database using a TableAdapter the data ends up in a DataTable....
8
by: Fuzzydave | last post by:
Okay, I have been handed a python project and working through it I have had to add a report. I am returning 10 variables the results of an SQL Query and as usual the number of results vary from...
7
by: john | last post by:
I've made an import macro to import bank transactions. Those transactions don't have an ID_number when downloaded from internet. They get it when they are added to the main transaction table in my...
1
by: kannan1983 | last post by:
In a table i have to check each and every column for null values . if the column has null value i need to display as ' NULL VALUE' in the output , for these iam declaring some local variables Iam...
4
by: barmatt80 | last post by:
I have created an unbound form so that when users enter the information, there is a save button they have to click, checking to make sure a field(txtDocketNo) is not blank. For some reason I cannot...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.