VB6 to VS.Net 2003 DLL change

D

David Wier

I'm trying to convert a VB6 DLL (that someone else wrote) - many lines are
parameters that need converting that have 'System.DBNull.Value' in the
original - - the report says this is an erroneous use of the Null/Isnull .
Here's the code:
If BillCust > 0 Then
Call colParams.Add(objDB.CreateADOParm("@BillCust",
ADODB.DataTypeEnum.adInteger, ADODB.ParameterDirectionEnum.adParamInput,
BillCust))
Else
'Error Message --------> 'UPGRADE_WARNING: Use of Null/IsNull() detected.
Click for more:
'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1049"'
Call colParams.Add(objDB.CreateADOParm("@BillCust",
ADODB.DataTypeEnum.adInteger, ADODB.ParameterDirectionEnum.adParamInput,
System.DBNull.Value))
End If

How can I change the 'Else' section so it will work in DotNet?
 
N

Norman Yuan

This may not answer your question, but, since it is database application
with ADO, it simply no point to convert it into .NET, if you still use ADO
in .NET. In .NET app, you should use ADO.NET, which is so different from
ADO, that you just cannot convert to it from an ADO app. You need to rewrite
the code of data access part. It is waste of time to do the conversion, IMO.
 
E

Elmo Watson

I respect your opinion, however, in this case it's fairly large VB6
dll - - - there are approximately 100 lines that do this kind of thing - -
I just need to find out how to replace the existing code with working DotNet
code - - that will go a long way to getting this thing working - -
Yes, there will be more cleanup - - but, by far, the majority is merely the
changing of lines like this.

AND - I don't have the time to sit down and re-write someone else's DLL
myself - - this will definitely be the quickest solution.

If someone has the actual answer to this question, I would appreciate it
greatly.
 

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

Top