Dennis
Wed Jun 29 18:28:02 CDT 2005
Sorry, I forgot to define a CommandBuilder...insert the following line just
after the Dim DBAdapt...
Dim DBCmdBuilder As New OleDb.OleDbCommandBuilder(DBAdapt)
--
Dennis in Houston
"Dennis" wrote:
> Try something like the below...not tested of course as I have no idea what ID
> is nor weapon_type nor Db Column, etc. are supposed be..I've assumed they are
> columns in your DataBase and somewhere you are inputing an ID to match to the
> DataBase ID column. I've also assumed that FunWeapon is a function that you
> define somewhere. Good Luck!
>
> Dim sql As String
> Dim strWeapon As String
> 'Define a DataSet and a Data Adapter
> Dim Dset as New DataSet
> Dim DBAdapt As New OleDbDataAdapter
> 'Define SQL search string (not sure about the <>DbNull as it may be
> different syntax required)
> strSQL = "SELECT ID, Db, Velocity, Weapon_Type FROM Q36 WHERE ID
> ='ID' AND Db<>DbNull AND Velocity<>DbNull"
> 'Open the DataSet and return rows found matching SQL search into
> Dataset
> DBAdapt.SelectCommand = New OleDb.OleDbCommand(strSQL, strConn)
> DBAdapt.Fill(Dset, "Q36")
> 'Iterate thru each row returned and reset the Weapon_Type Field
> Dim drow as DataRow
> For Each drow in Dset.Tables(0).Rows
> strWeapon =
> funWeaponType(Val(dr.Item("Db"),Val(dr.Item("Velocity)))
> If strWeapon <> dr.Item("Weapon_Type) Then
> dr.Item("Weapon_Type") = strWeapon
> next
> 'Update the DataBase
> DBAdapt.Update(Dset, "Q36")
> 'Clean up the objects
> DBAdapt.Dispose
> DSet.Dispose
> --
> Dennis in Houston
>
>
> "thomasp@msala.net" wrote:
>
> > Dennis,
> >
> > If you have time, could you post an example of using the DataSet with only
> > the needed columns?
> >
> > Thanks,
> >
> > Thomas
> >
> > P.S. I am doing all this in Iraq. I have a very simple web site that I am
> > trying to keep up while I am here. It just shows some of the daily stuff
> > that happens here.
> >
> >
http://www.msala.net/archives.php
> >
> > --
> > Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
> > ------->>>>>>
http://www.NewsDemon.com<<<<<<------
> > Unlimited Access, Anonymous Accounts, Uncensored Broadband Access
> >