Convertion from vb6 to vb.net

  • Thread starter Thread starter ReidarT
  • Start date Start date
R

ReidarT

I have an application in vb6 converted to vb.net
During debugging it stops at the folloewing code

If RsORDRE.Fields("Kommentar").Value <> "" Then
strKommentar = RsORDRE.Fields("Kommentar").Value
Else
strKommentar = ""
End If

The error is <>"" where Kommentar is a varchar field in the database
regards
reidarT
 
Reidar,

Are you sure it is not a DBNull.value?
What is mostly the problem in this kind of code.
(Not that I still know much about AdoDb)

Cor
 
It is a DBNull if that means there is no data in this field for this record
How can I ommit the problem?
reidarT
 
Reidar,

Probably, (I did not (do as I wrote) much AdoDb last times)

If RsORDRE.Fields("Kommentar").Value Is DbNull.value then

I hope this helps?

Cor
 
Thanks alot
Reidar
Cor Ligthert said:
Reidar,

Probably, (I did not (do as I wrote) much AdoDb last times)

If RsORDRE.Fields("Kommentar").Value Is DbNull.value then

I hope this helps?

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top