Got it... FYI
ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
filePath & ";Extended Properties=dBase IV"
Dim dBaseConnection As New
System.Data.OleDb.OleDbConnection(ConnectionString )
Try
dBaseConnection.Open()
Dim dBaseCommand As New System.Data.OleDb.OleDbCommand("select * from " &
dbfFile, dBaseConnection)
Dim dBaseDataReader As System.Data.OleDb.OleDbDataReader =
dBaseCommand.ExecuteReader(CommandBehavior.Sequent ialAccess)
While dBaseDataReader.Read
Dim parameter1 As String = dBaseDataReader("Colum2").ToString
Dim parameter2 As String = dBaseDataReader("Colum3").ToString
Dim updateCommand As New System.Data.OleDb.OleDbCommand("update " & dbfFile
& " set Column4 = '" & FSB(parameter1, parameter2) & "' where Column2 = '" &
parameter1 & "' and Column3 = '" & parameter2 & "'", dBaseConnection)
updateCommand.ExecuteNonQuery()
End While
Catch ex As Exception
MsgBox(ex.ToString)
Finally
dBaseConnection.Close()
End Try
"JFB" <jf*@help.comwrote in message
news:eB****************@TK2MSFTNGP04.phx.gbl...
Hi,
I have a connection to a dbase IV file using oledb. I wan to do an update
to
a field using a vb function passing two parameters. These 2 parameters are
fields from the same table.
What is the sintax to do this?
Thanks
JFB
ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
filePath & ";Extended Properties=dBase IV"
Dim dBaseConnection As New
System.Data.OleDb.OleDbConnection(ConnectionString )
Try
dBaseConnection.Open()
Dim dBaseCommand As New System.Data.OleDb.OleDbCommand("update " & dbfFile
&
" set Column4 = FSB(Column1, Column2)", dBaseConnection)
dBaseCommand.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.ToString)
Finally
dBaseConnection.Close()
End Try
Function FSB(ByVal inTrack As String, ByVal inRoute As String) As String
bla...bla....
End Function