J
Julian
I need to convert db field values from "1 - Attempted-Successful" to "Yes",
"2 - Attempted-Unsuccessful" to "No" and all other values need to be
NULL-ed. So here's my code:
Dim strQuery As String = "SELECT tblData.CoPayFundGrant,
tblData.M_DSS_SSA_Benefits, tblData.O_DSS_SSA_Benefits, " & _
"tblData.Ref_MPS, tblData.Ref_LA, tblData.Ref_DCMH,
tblData.Place_Comm, tblData.Rem_Comm, tblData.Core_Case_Man,
tblData.Ref_DCMH_Case_Man " & _
"FROM tblData;"
Dim rsDataManip As ADODB.Recordset = cnnJET.Execute(strQuery)
With rsDataManip
If Not .EOF Then
Dim NewDataValue As Object
For Each fldData As ADODB.Field In rsDataManip.Fields
Select Case fldData.Value
Case "1 - Attempted-Successful"
NewDataValue = "Yes"
Case "2 - Attempted-Unsuccessful"
NewDataValue = "No"
Case Else
NewDataValue = System.DBNull
End Select
Next
End If
End With
My question is- what do I declare the temp variable "NewDataValue" as?
PS. Can I do the above using a SQL command?
--
|
+-- Julian
|
+- VB.Net 2003
|
"2 - Attempted-Unsuccessful" to "No" and all other values need to be
NULL-ed. So here's my code:
Dim strQuery As String = "SELECT tblData.CoPayFundGrant,
tblData.M_DSS_SSA_Benefits, tblData.O_DSS_SSA_Benefits, " & _
"tblData.Ref_MPS, tblData.Ref_LA, tblData.Ref_DCMH,
tblData.Place_Comm, tblData.Rem_Comm, tblData.Core_Case_Man,
tblData.Ref_DCMH_Case_Man " & _
"FROM tblData;"
Dim rsDataManip As ADODB.Recordset = cnnJET.Execute(strQuery)
With rsDataManip
If Not .EOF Then
Dim NewDataValue As Object
For Each fldData As ADODB.Field In rsDataManip.Fields
Select Case fldData.Value
Case "1 - Attempted-Successful"
NewDataValue = "Yes"
Case "2 - Attempted-Unsuccessful"
NewDataValue = "No"
Case Else
NewDataValue = System.DBNull
End Select
Next
End If
End With
My question is- what do I declare the temp variable "NewDataValue" as?
PS. Can I do the above using a SQL command?
--
|
+-- Julian
|
+- VB.Net 2003
|