Hello,
I'm try to update data a column in the IDENTIFICATION_DATA based on partial match the AOP5 table. The problem is I don't know how to parse the string after 4 spaces and only consider 11 characters, for example the data in the identification table is in the following format: 00-028-1234. The data in the AOP5 table is in the following format 1305-00-028-1234(1). I only want to update insert data in the identification table when 00-028-1234 matches in both tables.
Thanks
Victor
Code:
Dim mySQL_Statement As String = "UPDATE IDENTIFICATION_DATA " & vbNewLine & _
" INNER JOIN " & vbNewLine & _
" aop5 " & vbNewLine & _
" ON IDENTIFICATION_DATA.NIIN " & _
" = aop5.NSN " & vbNewLine & _ ''''how do i modify this line to only search for data after the fifth position and the next 11 characters??
" SET IDENTIFICATION_DATA.NARC = " & _
" aop5.sn "
Dim ConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\aopt2002orgorg.mdb;Persist Security Info=True;Jet OLEDBatabase Password=testaopupdate"
Dim objConnection As New OleDb.OleDbConnection(ConnectionString)
'data adapter
Dim objDataAdapter As New OleDb.OleDbDataAdapter(mySQL_Statement, objConnection)
''dataset object
Dim objDataSet As New DataSet
' 'fill dataset
objConnection.Open()
objDataAdapter.Fill(objDataSet, "SN")
objConnection.Close()
MsgBox("Completed")
I'm try to update data a column in the IDENTIFICATION_DATA based on partial match the AOP5 table. The problem is I don't know how to parse the string after 4 spaces and only consider 11 characters, for example the data in the identification table is in the following format: 00-028-1234. The data in the AOP5 table is in the following format 1305-00-028-1234(1). I only want to update insert data in the identification table when 00-028-1234 matches in both tables.
Thanks
Victor
Code:
Dim mySQL_Statement As String = "UPDATE IDENTIFICATION_DATA " & vbNewLine & _
" INNER JOIN " & vbNewLine & _
" aop5 " & vbNewLine & _
" ON IDENTIFICATION_DATA.NIIN " & _
" = aop5.NSN " & vbNewLine & _ ''''how do i modify this line to only search for data after the fifth position and the next 11 characters??
" SET IDENTIFICATION_DATA.NARC = " & _
" aop5.sn "
Dim ConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\aopt2002orgorg.mdb;Persist Security Info=True;Jet OLEDBatabase Password=testaopupdate"
Dim objConnection As New OleDb.OleDbConnection(ConnectionString)
'data adapter
Dim objDataAdapter As New OleDb.OleDbDataAdapter(mySQL_Statement, objConnection)
''dataset object
Dim objDataSet As New DataSet
' 'fill dataset
objConnection.Open()
objDataAdapter.Fill(objDataSet, "SN")
objConnection.Close()
MsgBox("Completed")