Results 1 to 30 of 30

Thread: Help Resolving Syntax Error

Hybrid View

  1. #1
    Karen Payne MVP kareninstructor's Avatar
    Join Date
    Jun 2008
    Location
    Oregon
    Posts
    6,714

    Re: Help Resolving Syntax Error

    Change

    Code:
    & "PostCode = ?," _
    To

    Code:
    & "PostCode = ? " _

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Mar 2010
    Posts
    137

    Re: Help Resolving Syntax Error

    Quote Originally Posted by kevininstructor View Post
    Change

    Code:
    & "PostCode = ?," _
    To

    Code:
    & "PostCode = ? " _
    That fixed that error, thanks a lot! But now with this full code:
    vb Code:
    1. Public Sub g_sSaveCustomerRecord(ByVal oThisFormA As frmCaptureCustomer, _
    2.                                    ByVal sCusID As String, _
    3.                                    ByVal sDBNameA As String)
    4.         ' ---------------------------------------------------------------------
    5.         ' Incoming Parameters:
    6.         '       oThisFormA  - a reference to the current form
    7.         '                     of type frmDataCapture
    8.         '       sStudentNumberA - The student number
    9.         '       sDBNameA    - The Database File Name
    10.         ' Return value :
    11.         '       if save successfull (no validation issues) return empty string, ""
    12.         '       otherwise return error message
    13.         '------------------------------------------------------------
    14.         Dim sSaveSql As String
    15.         Dim sConnection As String
    16.         Dim sErrorMessage As String
    17.         Dim sSQL As String
    18.         Dim bStudentNumberExists As Boolean
    19.  
    20.         Dim oConn As OleDbConnection        'To reference a Connection obj.
    21.         Dim oCmd_Select As OleDbCommand     'To Instantiate a Command obj used to execute the Select SQL.
    22.         Dim oDataReader As OleDbDataReader  'To instantiate a DataReader obj.
    23.         Dim oCmd_Update As OleDbCommand     'To Instantiate a Command obj used to execute the Insert/Update SQL.
    24.  
    25.         'sErrorMessage = ""
    26.         oConn = Nothing
    27.         oCmd_Select = Nothing
    28.         oDataReader = Nothing
    29.         oCmd_Update = Nothing
    30.  
    31.         ' --- create a database command object and set the SQL statement
    32.         ' --- it will execute, and the database connection object associated to it
    33.         sConnection = "Provider=Microsoft.Jet.OLEDB.4.0;"
    34.         sConnection = sConnection & "User ID=Admin;"
    35.         sConnection = sConnection & "Data Source="
    36.         sConnection = sConnection & Application.StartupPath & "\" & sDBNameA
    37.         oConn = New OleDbConnection(sConnection)
    38.         oConn.Open()
    39.  
    40.         oCmd_Select = oConn.CreateCommand()
    41.         sSQL = "select ID from CUSTOMER where ID= " & sCusID & ""
    42.         oCmd_Select.CommandText = sSQL
    43.  
    44.         ' --- execute SQL command and place results into a datareader object
    45.         oDataReader = oCmd_Select.ExecuteReader()
    46.  
    47.         bStudentNumberExists = (oDataReader.Read() = True)
    48.  
    49.         'MessageBox.Show("bStudentNumberExists=" & bStudentNumberExists)
    50.         ' --- Build Insert or Update Sql depending if record retrieved with select query is found
    51.         If bStudentNumberExists Then
    52.             Using cmd As OleDbCommand = New OleDbCommand
    53.                 sSaveSql = "update CUSTOMER set " _
    54.                                & "Surname = ?," _
    55.                                & "Given = ?," _
    56.                                & "DateOfBirth = ?, " _
    57.                                & "Sex = ?," _
    58.                                & "Phone = ?," _
    59.                                & "Address = ?," _
    60.                                & "Suburb = ?," _
    61.                                & "State = ?," _
    62.                                & "PostCode = ? " _
    63.                                & "where ID = ?;"
    64.  
    65.                 cmd.Parameters.AddWithValue("@Surname", oThisFormA.txtCusSurname.Text.Trim)
    66.                 cmd.Parameters.AddWithValue("@Given", oThisFormA.txtCustGiven.Text.Trim)
    67.                 cmd.Parameters.AddWithValue("@DateOfBirth", CDate(oThisFormA.txtCustDOB.Text.Trim))
    68.                 cmd.Parameters.AddWithValue("@Sex", oThisFormA.txtCustSex.Text.Trim)
    69.                 cmd.Parameters.AddWithValue("@Phone", oThisFormA.txtCustPhone.Text.Trim)
    70.                 cmd.Parameters.AddWithValue("@Address", oThisFormA.txtCustAddress.Text.Trim)
    71.                 cmd.Parameters.AddWithValue("@Suburb", oThisFormA.txtCustSuburb.Text.Trim)
    72.                 cmd.Parameters.AddWithValue("@State", oThisFormA.txtCustState.Text.Trim)
    73.                 cmd.Parameters.AddWithValue("@PostCode", oThisFormA.txtCustPostCode.Text.Trim)
    74.                 cmd.Parameters.AddWithValue("@ID", CInt(oThisFormA.txtCustID.Text.Trim))
    75.  
    76.             End Using
    77.             'sSaveSql = "update CUSTOMER set " _
    78.             '             & "Surname = '" & oThisFormA.txtCusSurname.Text.Trim & "'," _
    79.             '             & "Given = '" & oThisFormA.txtCustGiven.Text.Trim & "'," _
    80.             '             & "DateOfBirth = '" & oThisFormA.txtCustDOB.Text.Trim & "', " _
    81.             '             & "Sex = '" & oThisFormA.txtCustSex.Text.Trim & "'," _
    82.             '             & "Phone = '" & oThisFormA.txtCustPhone.Text.Trim & "'," _
    83.             '             & "Address = '" & oThisFormA.txtCustAddress.Text.Trim & "'," _
    84.             '             & "Suburb = '" & oThisFormA.txtCustSuburb.Text.Trim & "'," _
    85.             '             & "State = '" & oThisFormA.txtCustState.Text.Trim & "'," _
    86.             '             & "PostCode = '" & oThisFormA.txtCustPostCode.Text.Trim & "'," _
    87.             '             & "where ID ='" & oThisFormA.txtCustID.Text.Trim & "';"
    88.  
    89.             'Else
    90.             '    sSaveSql = "insert into CUSTOMER(ID, Surname, Given, DateOfBirth,Sex,Phone,Address,Suburb,State,PostCode) " _
    91.             '             & " values('" & oThisFormA.txtCustID.Text & "'," _
    92.             '             & "'" & oThisFormA.txtCusSurname.Text.Trim & "'," _
    93.             '             & "'" & oThisFormA.txtCustGiven.Text.Trim & "'," _
    94.             '             & "'" & oThisFormA.txtCustDOB.Text.Trim & "'," _
    95.             '             & "'" & oThisFormA.txtCustSex.Text.Trim & "'," _
    96.             '             & "'" & oThisFormA.txtCustPhone.Text.Trim & "'," _
    97.             '             & "'" & oThisFormA.txtCustAddress.Text.Trim & "'," _
    98.             '             & "'" & oThisFormA.txtCustSuburb.Text.Trim & "'," _
    99.             '             & "'" & oThisFormA.txtCustState.Text.Trim & "'," _
    100.             '             & "'" & oThisFormA.txtCustPostCode.Text.Trim & "' )"
    101.             '    MsgBox("ID:" & sCusID & " has been Added to the table")
    102.  
    103.  
    104.             '    ' Be careful however with the commas and the closing bracket
    105.         End If
    106.  
    107.  
    108.         oDataReader.Close()
    109.         oCmd_Select.Dispose()
    110.  
    111.  
    112.         ' Execute sql update or insert query:
    113.         oCmd_Update = oConn.CreateCommand()
    114.         oCmd_Update.CommandText = sSaveSql
    115.         oCmd_Update.ExecuteNonQuery()
    116.  
    117.  
    118.  
    119.  
    120.  
    121.  
    122.     End Sub

    I get Erro:
    Code:
    No value given for one or more required parameters.
    Any Idea why?

    I have done a debug and every txt box had a vale assigned to it.

  3. #3
    Karen Payne MVP kareninstructor's Avatar
    Join Date
    Jun 2008
    Location
    Oregon
    Posts
    6,714

    Re: Help Resolving Syntax Error

    Good to hear that fixed the first error, using parameters along with you statement w/o string concatenation allows you to examine said statement easier to spot issues.

    For example the following returns a string which is easy to locate issues.
    Code:
    Dim UpdateStatement = _
    <SQL>
        UPDATE CUSTOMER set 
            Surname = ?,
            Given = ?,
            DateOfBirth = ?, 
            Sex = ?,
            Phone = ?,
            Address = ?,
            Suburb = ?,
            State = ?,
            PostCode = ?
        WHERE ID = ?
    </SQL>.Value

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Mar 2010
    Posts
    137

    Re: Help Resolving Syntax Error

    Quote Originally Posted by kevininstructor View Post
    Good to hear that fixed the first error, using parameters along with you statement w/o string concatenation allows you to examine said statement easier to spot issues.

    For example the following returns a string which is easy to locate issues.
    Code:
    Dim UpdateStatement = _
    <SQL>
        UPDATE CUSTOMER set 
            Surname = ?,
            Given = ?,
            DateOfBirth = ?, 
            Sex = ?,
            Phone = ?,
            Address = ?,
            Suburb = ?,
            State = ?,
            PostCode = ?
        WHERE ID = ?
    </SQL>.Value
    Sorry to bug ya mate, im new to vb haha so not to sure what you want me to do with that piece of code

  5. #5
    Karen Payne MVP kareninstructor's Avatar
    Join Date
    Jun 2008
    Location
    Oregon
    Posts
    6,714

    Re: Help Resolving Syntax Error

    Quote Originally Posted by coccoster View Post
    Sorry to bug ya mate, im new to vb haha so not to sure what you want me to do with that piece of code
    Lets simplify it by taking the variable out, this is your SQL statement assigned directly to the commmand's command text.
    Code:
    Using cmd As OleDbCommand = New OleDbCommand
        cmd.CommandText = _
        <SQL>
        UPDATE CUSTOMER set 
            Surname = ?,
            Given = ?,
            DateOfBirth = ?, 
            Sex = ?,
            Phone = ?,
            Address = ?,
            Suburb = ?,
            State = ?,
            PostCode = ?
        WHERE ID = ?
        </SQL>.Value
    
    End Using

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Mar 2010
    Posts
    137

    Re: Help Resolving Syntax Error

    Quote Originally Posted by kevininstructor View Post
    Lets simplify it by taking the variable out, this is your SQL statement assigned directly to the commmand's command text.
    Code:
    Using cmd As OleDbCommand = New OleDbCommand
        cmd.CommandText = _
        <SQL>
        UPDATE CUSTOMER set 
            Surname = ?,
            Given = ?,
            DateOfBirth = ?, 
            Sex = ?,
            Phone = ?,
            Address = ?,
            Suburb = ?,
            State = ?,
            PostCode = ?
        WHERE ID = ?
        </SQL>.Value
    
    End Using
    I commented out the other code you gave me and pasted that code instead.. The only error i got was
    Code:
    "Command text was not set for the command object."
    Not sure im doing the right thing though.

  7. #7
    Karen Payne MVP kareninstructor's Avatar
    Join Date
    Jun 2008
    Location
    Oregon
    Posts
    6,714

    Re: Help Resolving Syntax Error

    Quote Originally Posted by coccoster View Post
    I commented out the other code you gave me and pasted that code instead.. The only error i got was
    Code:
    "Command text was not set for the command object."
    Not sure im doing the right thing though.
    Not sure either as the code is clearly setting the CommandText ie
    Code:
            Using cmd As OleDbCommand = New OleDbCommand
                cmd.CommandText = _
                <SQL>
                UPDATE CUSTOMER set 
                    Surname = ?,
                    Given = ?,
                    DateOfBirth = ?, 
                    Sex = ?,
                    Phone = ?,
                    Address = ?,
                    Suburb = ?,
                    State = ?,
                    PostCode = ?
                WHERE ID = ?
                </SQL>.Value
    
                MsgBox(cmd.CommandText)
            End Using
    Or
    Code:
            Using cmd As OleDbCommand = New OleDbCommand
                cmd.CommandText = _
                <SQL>
                UPDATE CUSTOMER set 
                    Surname = ?,
                    Given = ?,
                    DateOfBirth = ?, 
                    Sex = ?,
                    Phone = ?,
                    Address = ?,
                    Suburb = ?,
                    State = ?,
                    PostCode = ?
                WHERE ID = ?
                </SQL>.Value
    
                Console.WriteLine(cmd.CommandText)
            End Using
    Result from console write line
    Code:
                UPDATE CUSTOMER set 
                    Surname = ?,
                    Given = ?,
                    DateOfBirth = ?, 
                    Sex = ?,
                    Phone = ?,
                    Address = ?,
                    Suburb = ?,
                    State = ?,
                    PostCode = ?
                WHERE ID = ?

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Mar 2010
    Posts
    137

    Re: Help Resolving Syntax Error

    Quote Originally Posted by kevininstructor View Post
    Not sure either as the code is clearly setting the CommandText ie
    Code:
            Using cmd As OleDbCommand = New OleDbCommand
                cmd.CommandText = _
                <SQL>
                UPDATE CUSTOMER set 
                    Surname = ?,
                    Given = ?,
                    DateOfBirth = ?, 
                    Sex = ?,
                    Phone = ?,
                    Address = ?,
                    Suburb = ?,
                    State = ?,
                    PostCode = ?
                WHERE ID = ?
                </SQL>.Value
    
                MsgBox(cmd.CommandText)
            End Using
    Or
    Code:
            Using cmd As OleDbCommand = New OleDbCommand
                cmd.CommandText = _
                <SQL>
                UPDATE CUSTOMER set 
                    Surname = ?,
                    Given = ?,
                    DateOfBirth = ?, 
                    Sex = ?,
                    Phone = ?,
                    Address = ?,
                    Suburb = ?,
                    State = ?,
                    PostCode = ?
                WHERE ID = ?
                </SQL>.Value
    
                Console.WriteLine(cmd.CommandText)
            End Using
    Result from console write line
    Code:
                UPDATE CUSTOMER set 
                    Surname = ?,
                    Given = ?,
                    DateOfBirth = ?, 
                    Sex = ?,
                    Phone = ?,
                    Address = ?,
                    Suburb = ?,
                    State = ?,
                    PostCode = ?
                WHERE ID = ?
    Does the code i posted before look right to you?

  9. #9
    Karen Payne MVP kareninstructor's Avatar
    Join Date
    Jun 2008
    Location
    Oregon
    Posts
    6,714

    Re: Help Resolving Syntax Error

    The following will work if you have Option Infer On and using Framework 3.5 or higher (VS2008 or VS2010)

    I highly suggest turning Option Strict On

    Code:
            If bStudentNumberExists Then
    
                Using cmd As OleDbCommand = New OleDbCommand
    				cmd.CommandText = _
    				<SQL>
    				UPDATE CUSTOMER set 
    					Surname = ?,
    					Given = ?,
    					DateOfBirth = ?, 
    					Sex = ?,
    					Phone = ?,
    					Address = ?,
    					Suburb = ?,
    					State = ?,
    					PostCode = ?
    				WHERE ID = ?
    				</SQL>.Value
    
    
                    cmd.Parameters.AddWithValue("@Surname", oThisFormA.txtCusSurname.Text.Trim)
                    cmd.Parameters.AddWithValue("@Given", oThisFormA.txtCustGiven.Text.Trim)
                    cmd.Parameters.AddWithValue("@DateOfBirth", CDate(oThisFormA.txtCustDOB.Text.Trim))
                    cmd.Parameters.AddWithValue("@Sex", oThisFormA.txtCustSex.Text.Trim)
                    cmd.Parameters.AddWithValue("@Phone", oThisFormA.txtCustPhone.Text.Trim)
                    cmd.Parameters.AddWithValue("@Address", oThisFormA.txtCustAddress.Text.Trim)
                    cmd.Parameters.AddWithValue("@Suburb", oThisFormA.txtCustSuburb.Text.Trim)
                    cmd.Parameters.AddWithValue("@State", oThisFormA.txtCustState.Text.Trim)
                    cmd.Parameters.AddWithValue("@PostCode", oThisFormA.txtCustPostCode.Text.Trim)
                    cmd.Parameters.AddWithValue("@ID", CInt(oThisFormA.txtCustID.Text.Trim))
    
    
                End Using
    
            End If

  10. #10
    Karen Payne MVP kareninstructor's Avatar
    Join Date
    Jun 2008
    Location
    Oregon
    Posts
    6,714

    Re: Help Resolving Syntax Error

    Here is another example

    Original
    Code:
    sSQL = "select ID from CUSTOMER where ID= " & sCusID & ""
    Alternate
    Code:
    Dim sSQL = <SQL>select ID from CUSTOMER where ID= <%= sCusID %></SQL>.Value
    Both do the same thing but the second one w/o concatenation

  11. #11

    Thread Starter
    Addicted Member
    Join Date
    Mar 2010
    Posts
    137

    Re: Help Resolving Syntax Error

    Quote Originally Posted by kevininstructor View Post
    Here is another example

    Original
    Code:
    sSQL = "select ID from CUSTOMER where ID= " & sCusID & ""
    Alternate
    Code:
    Dim sSQL = <SQL>select ID from CUSTOMER where ID= <%= sCusID %></SQL>.Value
    Both do the same thing but the second one w/o concatenation
    Ohh ok..

    I un commented out everything, and did what you just posted..

    Still get the same error as above:
    Code:
    "Command text was not set for the command object."
    Sp full code looks like:

    vb Code:
    1. Public Sub g_sSaveCustomerRecord(ByVal oThisFormA As frmCaptureCustomer, _
    2.                                    ByVal sCusID As String, _
    3.                                    ByVal sDBNameA As String)
    4.         ' ---------------------------------------------------------------------
    5.         ' Incoming Parameters:
    6.         '       oThisFormA  - a reference to the current form
    7.         '                     of type frmDataCapture
    8.         '       sStudentNumberA - The student number
    9.         '       sDBNameA    - The Database File Name
    10.         ' Return value :
    11.         '       if save successfull (no validation issues) return empty string, ""
    12.         '       otherwise return error message
    13.         '------------------------------------------------------------
    14.         Dim sSaveSql As String
    15.         Dim sConnection As String
    16.         Dim sErrorMessage As String
    17.         Dim sSQL As String
    18.         Dim bStudentNumberExists As Boolean
    19.  
    20.         Dim oConn As OleDbConnection        'To reference a Connection obj.
    21.         Dim oCmd_Select As OleDbCommand     'To Instantiate a Command obj used to execute the Select SQL.
    22.         Dim oDataReader As OleDbDataReader  'To instantiate a DataReader obj.
    23.         Dim oCmd_Update As OleDbCommand     'To Instantiate a Command obj used to execute the Insert/Update SQL.
    24.  
    25.         'sErrorMessage = ""
    26.         oConn = Nothing
    27.         oCmd_Select = Nothing
    28.         oDataReader = Nothing
    29.         oCmd_Update = Nothing
    30.  
    31.         ' --- create a database command object and set the SQL statement
    32.         ' --- it will execute, and the database connection object associated to it
    33.         sConnection = "Provider=Microsoft.Jet.OLEDB.4.0;"
    34.         sConnection = sConnection & "User ID=Admin;"
    35.         sConnection = sConnection & "Data Source="
    36.         sConnection = sConnection & Application.StartupPath & "\" & sDBNameA
    37.         oConn = New OleDbConnection(sConnection)
    38.         oConn.Open()
    39.  
    40.         oCmd_Select = oConn.CreateCommand()
    41.         sSQL = <SQL>select ID from CUSTOMER where ID= <%= sCusID %></SQL>.Value
    42.         'sSQL = "select ID from CUSTOMER where ID= " & sCusID & ""
    43.         oCmd_Select.CommandText = sSQL
    44.  
    45.         ' --- execute SQL command and place results into a datareader object
    46.         oDataReader = oCmd_Select.ExecuteReader()
    47.  
    48.         bStudentNumberExists = (oDataReader.Read() = True)
    49.  
    50.         'MessageBox.Show("bStudentNumberExists=" & bStudentNumberExists)
    51.         ' --- Build Insert or Update Sql depending if record retrieved with select query is found
    52.         If bStudentNumberExists Then
    53.  
    54.             Using cmd As OleDbCommand = New OleDbCommand
    55.                 sSaveSql = "update CUSTOMER set " _
    56.                                & "Surname = ?," _
    57.                                & "Given = ?," _
    58.                                & "DateOfBirth = ?, " _
    59.                                & "Sex = ?," _
    60.                                & "Phone = ?," _
    61.                                & "Address = ?," _
    62.                                & "Suburb = ?," _
    63.                                & "State = ?," _
    64.                                & "PostCode = ? " _
    65.                                & "where ID = ?;"
    66.  
    67.                 cmd.Parameters.AddWithValue("@Surname", oThisFormA.txtCusSurname.Text.Trim)
    68.                 cmd.Parameters.AddWithValue("@Given", oThisFormA.txtCustGiven.Text.Trim)
    69.                 cmd.Parameters.AddWithValue("@DateOfBirth", CDate(oThisFormA.txtCustDOB.Text.Trim))
    70.                 cmd.Parameters.AddWithValue("@Sex", oThisFormA.txtCustSex.Text.Trim)
    71.                 cmd.Parameters.AddWithValue("@Phone", oThisFormA.txtCustPhone.Text.Trim)
    72.                 cmd.Parameters.AddWithValue("@Address", oThisFormA.txtCustAddress.Text.Trim)
    73.                 cmd.Parameters.AddWithValue("@Suburb", oThisFormA.txtCustSuburb.Text.Trim)
    74.                 cmd.Parameters.AddWithValue("@State", oThisFormA.txtCustState.Text.Trim)
    75.                 cmd.Parameters.AddWithValue("@PostCode", oThisFormA.txtCustPostCode.Text.Trim)
    76.                 cmd.Parameters.AddWithValue("@ID", CInt(oThisFormA.txtCustID.Text.Trim))
    77.  
    78.  
    79.             End Using
    80.             'sSaveSql = "update CUSTOMER set " _
    81.             '             & "Surname = '" & oThisFormA.txtCusSurname.Text.Trim & "'," _
    82.             '             & "Given = '" & oThisFormA.txtCustGiven.Text.Trim & "'," _
    83.             '             & "DateOfBirth = '" & oThisFormA.txtCustDOB.Text.Trim & "', " _
    84.             '             & "Sex = '" & oThisFormA.txtCustSex.Text.Trim & "'," _
    85.             '             & "Phone = '" & oThisFormA.txtCustPhone.Text.Trim & "'," _
    86.             '             & "Address = '" & oThisFormA.txtCustAddress.Text.Trim & "'," _
    87.             '             & "Suburb = '" & oThisFormA.txtCustSuburb.Text.Trim & "'," _
    88.             '             & "State = '" & oThisFormA.txtCustState.Text.Trim & "'," _
    89.             '             & "PostCode = '" & oThisFormA.txtCustPostCode.Text.Trim & "'," _
    90.             '             & "where ID ='" & oThisFormA.txtCustID.Text.Trim & "';"
    91.  
    92.             'Else
    93.             '    sSaveSql = "insert into CUSTOMER(ID, Surname, Given, DateOfBirth,Sex,Phone,Address,Suburb,State,PostCode) " _
    94.             '             & " values('" & oThisFormA.txtCustID.Text & "'," _
    95.             '             & "'" & oThisFormA.txtCusSurname.Text.Trim & "'," _
    96.             '             & "'" & oThisFormA.txtCustGiven.Text.Trim & "'," _
    97.             '             & "'" & oThisFormA.txtCustDOB.Text.Trim & "'," _
    98.             '             & "'" & oThisFormA.txtCustSex.Text.Trim & "'," _
    99.             '             & "'" & oThisFormA.txtCustPhone.Text.Trim & "'," _
    100.             '             & "'" & oThisFormA.txtCustAddress.Text.Trim & "'," _
    101.             '             & "'" & oThisFormA.txtCustSuburb.Text.Trim & "'," _
    102.             '             & "'" & oThisFormA.txtCustState.Text.Trim & "'," _
    103.             '             & "'" & oThisFormA.txtCustPostCode.Text.Trim & "' )"
    104.             '    MsgBox("ID:" & sCusID & " has been Added to the table")
    105.  
    106.  
    107.             '    ' Be careful however with the commas and the closing bracket
    108.         End If
    109.  
    110.  
    111.         oDataReader.Close()
    112.         oCmd_Select.Dispose()
    113.  
    114.  
    115.         ' Execute sql update or insert query:
    116.         oCmd_Update = oConn.CreateCommand()
    117.         oCmd_Update.CommandText = sSaveSql
    118.         oCmd_Update.ExecuteNonQuery()
    119.  
    120.  
    121.  
    122.  
    123.  
    124.  
    125.     End Sub

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