If I execute the program from within Visual Studio, the program runs absolutely fine. Once I put the .exe from debug on a different computer, it gives a error of No Value Given for One or More required parameters.

I know that it could be that the parameters are incorrect, but I don't specifiy the column my data appends to when it's saved to the database. It just fills in each column across. Any help is appreciated!

ALSO! Even though this error pops up, I am still able to save to the database. But as this is for the company i work for, I don't want an error to come up at all. If any additional info is needed, just ask and I'll post! Thanks in advance!

Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click


        'Check for Data in Design, Color, and Quality Text Box
        If txtDesign.Text = String.Empty Then
            MsgBox("Please Enter a Design Name!")
            Exit Sub
        End If

        If txtColor.Text = String.Empty Then
            MsgBox("Please Enter a Color Number!")
            Exit Sub
        End If

        If txtQuality.Text = String.Empty Then
            MsgBox("Please Enter a Quality!")
            Exit Sub
        End If

        'Create Key for Use with Data Base

        Dim design = txtDesign.Text
        Dim color = txtColor.Text
        Dim quality = txtQuality.Text

        Dim design1 = design.Length / 2
        Dim quality1 = design.Length / 2

        Dim designKey = design.Substring(0, design1)
        Dim qualityKey = quality.Substring(0, quality1)
        Dim runDate As Date
        runDate = Date.Now

        Dim d As String = Format(runDate, "MMddyyyy")


        Dim runKey = designKey + color + qualityKey + d

        'Create Formatted Time for Time of Entry

        Dim defectTime As Date
        defectTime = TimeOfDay

        'Append Data to the Data Grid View

        logView.Rows.Add(New Object() _
                             {txtGradeCode.Text, txtColorGrade.Text, _
                              txtDefect.Text, defectTime, txtNotified.Text, txtInspector.Text, txtComment.Text, runKey})


        Try

            con = New OleDb.OleDbConnection
            Dim strPath As String
            strPath = Path.GetDirectoryName(Application.ExecutablePath)
            con.ConnectionString = "PROVIDER = Microsoft.ACE.OLEDB.12.0; Data Source = C:\Users\God\QualityLog.accdb;"


            Dim SQL As String

            SQL = "INSERT INTO [Quality Log] VALUES ('" & runKey & "','" & txtGradeCode.Text & "', '" & txtColorGrade.Text & "', '" & txtDefect.Text & "', '" & defectTime & "', '" & txtNotified.Text & "', '" & txtInspector.Text & "', '" & txtComment.Text & "')"
            cmd = New OleDb.OleDbCommand(SQL, con)

            con.Open()

            cmd.ExecuteNonQuery()
            con.Close()



        Catch ex As Exception
            MsgBox(ex.Message)

        End Try

        txtComment.Clear()

    End Sub

You can't just copy the exe file to another computer and run it. You have to create an installer, then run it on the target computer so that all of the required components are also made available. Microsoft has a walkthrough on how to deploy a windows applicatiion here. There are several versions of this for different versions of Visual Studio so you may have to search for a version specific to your IDE.

I've done that already and it has the same issues.

However, I did get it working by having a blank copy of the database in the same location the .exe is and having the real database at the specified location by the app. thanks for the reply! I never knew how complicated vb could be with what would seem to be the most simplest. Especially when designating an .ico file for the program. I used one file, then decided to change it. It took me 30 minutes and changing around different files for it to se the .ico properly.

thanks for the reply!

This article has been dead for over six months. Start a new discussion instead.