CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2010
    Posts
    18

    Technical Help - Null - Reg.

    Dear Friends,

    Good Morning.

    I need 2 helps from your end.

    1. I have designing one VB application with SQL Server Backend (10 Tables). This package will be used all over my country.

    So I have purchased one hosting space with a SQL Database and connected pacca.

    I am going to load my package in 20 – 50 dedicated Laptops (with Datacard for Internet) and handover it to Field Officers.

    They will go to client place and collect their informations and enter into my package.

    But now I am facing a new issue. That is some time they can’t get internet connection properly due to some reason.

    So I have planned Load SQL Server into all laptops and put a options – On-Line & Off-Line. If internet connection available, they can enter on-line. If not, they can use Off-line.

    But my query is, I have put a ID (Estate ID) is autoincrement. If they enter into off-line,it may chance to conflict. And I must provide to transfer their offline entries into on-line.

    How can we transfer 10 Tables (Off-line) datas into on-line in a single shot?

    What we can do for that Estate ID?


    --------------------------------------------------------------------------
    2. rs2.Open "select max(id) from tbl_own", cn, adOpenDynamic, adLockOptimistic
    If rs2.RecordCount = 0 Then
    id = 0
    Else
    id = rs2(0)
    End If
    id = id + 1
    txtestid.Text = id


    In the above code, query returs one row, that is Null if that table doesn't contain 0 value. So I need set to that "id=0". But its not working.

    And i have checked the following code also

    If rs2(0)=Null then
    id=0


    Its also not working.

    So please i am expecting a good reply for my above 2 queries.

    Thanks & Regards,

    Guna

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Technical Help - Null - Reg.

    Assign each user a number/name and use that for the key, rather than autonumber. They are rarely useful.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Aug 2010
    Posts
    18

    Re: Technical Help - Null - Reg.

    Dear Friend,

    Thanks for your suggestions.

    Can you tell me the procedure to the following things.

    1. How can we transfer 10 Tables (Off-line) datas into on-line in a single shot?

    2. rs2.Open "select max(id) from tbl_own", cn, adOpenDynamic, adLockOptimistic
    If rs2.RecordCount = 0 Then
    id = 0
    Else
    id = rs2(0)
    End If
    id = id + 1
    txtestid.Text = id

    In the above code, query returs one row, that is Null if that table doesn't contain 0 value. So I need set to that "id=0". But its not working.

    And i have checked the following code also

    If rs2(0)=Null then
    id=0

    Its also not working.


    Thanks & Regards,

    Guna

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured