Solved

Update Excel Spreadsheet where value is blank not working

Posted on 2013-05-28
2
237 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
2 Comments
 
LVL 45

Accepted Solution

by:
aikimark earned 500 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now