Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Update Excel Spreadsheet where value is blank not working

Posted on 2013-05-28
2
Medium Priority
?
243 Views
Last Modified: 2013-05-29
Hi,

The code below does not work... How to I check if Payer Claim Number is blank?   It works if I add a real value but that's the problem i'm facing.

Thanks
~j

        Dim path = "C:\Users\A303375\cc\ICD10\files\Sample Alternative Approach ICD10 Claims Data_UW_BACKUP.xlsx" '"c:\users\a303375\Desktop\Book1.xlsx"
        Dim connStr As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + path + ";Extended Properties=Excel 12.0;"
        Try
            Dim MyConnection As System.Data.OleDb.OleDbConnection
            Dim myCommand As New System.Data.OleDb.OleDbCommand
            Dim sql As String

            MyConnection = New System.Data.OleDb.OleDbConnection(connStr)
            MyConnection.Open()
            myCommand.Connection = MyConnection
            'sql = "Update [Sheet1$] set [C3] = 'New Name' where id=1"
            sql = "Update [ICD10 Data$] set [Result] = 'Incomplete' WHERE [Payer Claim Number]=''"

            myCommand.CommandText = sql
            myCommand.ExecuteNonQuery()
            MyConnection.Close()
        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try

Open in new window

0
Comment
Question by:prosit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 46

Accepted Solution

by:
aikimark earned 2000 total points
ID: 39204622
Try
WHERE [Payer Claim Number] Is Null

Open in new window

0
 
LVL 2

Author Closing Comment

by:prosit
ID: 39204668
I had tried "= Null"...

"IS NULL" was the difference...  ugh...

thanks

~j
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question