Advertisement

08.12.2008 at 02:36AM PDT, ID: 23640574
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.8

How to stop duplicates being written from VB6 code to SQL Table

Asked by Latzi_Marian in Visual Basic Programming, VB Controls

Tags: , ,

I have a project where I have to write to an SQL database some values (32 values) .Here's the routine which does the job:

Private Sub Write_To_SQL()
    Dim Var
    Dim sDate As String
    Dim Connection, RS
    Dim rsField, iFieldCount
    Dim SQLStmt As String
    Dim sstring As String
    sDate = Format(DateTime.Now, vbGeneralDate)
   
    Set Connection = CreateObject("ADODB.Connection")
   
    Set RS = New ADODB.Recordset
   
    Connection.Open "driver=SQL Server;server=(local);uid=;pwd=;database=DATA_LOG;"
 

    SQLStmt = "INSERT INTO    Recipes_West_Table   " & _
    "Values( '" & Label4.Caption & "' ," & Form1.txtVal1.Text & "," & Label3.Caption & ")"
 
    Set RS = Connection.Execute(SQLStmt)
    Remove_Group
    Var = 1
End Sub

No problems it works if I trigger the subroutine from a button.Like
Private Sub Command1_Click()
Write_To_SQL
End Sub
But unfortunately I have to trigger the Write_To_SQL subroutine from a textbox values.Namely when
IF Form1.Text1.Text = "1" then
Write to SQL
End If
The problem is that the Text.Text stays 1 for various lenghts of time.So To avoid triggering twice the Wrtite_To_SQL routine I have to put some conditions like if the Write_To_SQL is executed and Form1.Text1.Text hasn't done a TRANSITION from Text1.Text = " 1"  to Text1.Text = "0" and then AGAIN to Text1.Text = "1" (This is the point I have to write to SQL again) ,then don't trigger the routine.I've tried all sorts of tricks trying to build some "flip/flop" to detect transitions of Text1.Text from 1 to 0 to 1 --> write.I just don't know what are the best practices to do this kind of thing.Please help if someone got an ideea.ThanxStart Free Trial
[+][-]08.12.2008 at 02:41AM PDT, ID: 22211306

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.12.2008 at 02:47AM PDT, ID: 22211338

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.12.2008 at 02:49AM PDT, ID: 22211351

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.12.2008 at 02:54AM PDT, ID: 22211375

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.12.2008 at 03:16AM PDT, ID: 22211468

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Visual Basic Programming, VB Controls
Tags: Microsoft, VB6, 2000
Sign Up Now!
Solution Provided By: angelIII
Participating Experts: 2
Solution Grade: A
 
 
[+][-]08.12.2008 at 04:02AM PDT, ID: 22211677

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.12.2008 at 04:14AM PDT, ID: 22211730

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.12.2008 at 05:45AM PDT, ID: 22212420

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.12.2008 at 05:52AM PDT, ID: 22212504

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-44 / EE_QW_2_20070628