LOL! I thought someone would have said something sooner:)
It just made sense to me...it was a data adapter for the assets....but it
still made me chuckle.
"sloan" <sloan@ipass.ne twrote in message
news:OOntyqZ7IH A.2416@TK2MSFTN GP02.phx.gbl...
>
Now you can work on your naming conventions.
>
The @$$Adaptor sounds like something you use to get a colonoscopy and you
have an oversized or undersized butt. (ha ha).
>
..
>
>
>
"bill" <bill@bottlegar den.comwrote in message
news:ubas75J7IH A.4108@TK2MSFTN GP04.phx.gbl...
>
>
Now you can work on your naming conventions.
>
The @$$Adaptor sounds like something you use to get a colonoscopy and you
have an oversized or undersized butt. (ha ha).
>
..
>
>
>
"bill" <bill@bottlegar den.comwrote in message
news:ubas75J7IH A.4108@TK2MSFTN GP04.phx.gbl...
>Oh man, I should have seen that. I comment out that lin, add the con to
>the second and it works perfectly. Thank you so much! You have been
>incredibly helpful and patient and I really appreciate it. I have
>learned allot!
>Thank you!
>Bill Bray
>>
>"Jack Jackson" <jjackson@cinno vations.netwrot e in message
>news:pkid841jv 1v9t9r705clrbc5 bphn5u8kgr@4ax. com...
>>
>>
>the second and it works perfectly. Thank you so much! You have been
>incredibly helpful and patient and I really appreciate it. I have
>learned allot!
>Thank you!
>Bill Bray
>>
>"Jack Jackson" <jjackson@cinno vations.netwrot e in message
>news:pkid841jv 1v9t9r705clrbc5 bphn5u8kgr@4ax. com...
>>Sure. The message says it all. The DataAdapter's Select command,
>>which is built from the text you pass to the DataAdapter's
>>constructor , doesn't have any connection info.
>>>
>>See my comments below.
>>>
>>>>assCmd = New OleDb.OleDbComm and( _
>>>> "SELECT * from tblAssets where asset_tag=?", Con)
>>>>assAdapte r = New OleDbAdapter(as sCmd)
>>>
>>On Tue, 22 Jul 2008 18:05:09 -0600, "bill" <bill@bottlegar den.com>
>>wrote:
>>>
>>>>Thank you again! That got it:) Though there is more now.... I get an
>>>>error
>>>>at "assAdapter.fil l(assDT)" that says "fill: SelectCommand.C onnection
>>>>property has not been initialized? Do you see why?
>>>>Dim Con = New OleDb.OleDbConn ection("provide r=microsoft.jet .oledb.4.0;"
>>>>&
>>>>"data source=c:\_Arch ive\Documentati on - Projects\Hardwa re Tracking -
>>>>2008\IT_Ass ets.mdb")
>>>
>>The following line creates an OleDbCommand without a connection
>>object.
>>>
>>>>Dim assCmd As New OleDb.OleDbComm and("SELECT * from tblAssets where
>>>>asset_tag=? ")
>>>>
>>>>Dim assAdapter As OleDb.OleDbData Adapter
>>>
>>The following line creates a DataAdapter from the OleDbCommand object
>>that doesn't have a connection object.
>>>
>>>>assAdapte r = New OleDb.OleDbData Adapter(assCmd)
>>>>
>>>>'Dim assCmd As OleDb.OleDbComm and
>>>
>>The following line creates a second command object with the same
>>select as the previous one, this time with a connection object. This
>>command object is never used. You should get rid of this line, and
>>add Con as a second parameter to the previous OleDbCommand.
>>>
>>>>assCmd = New OleDb.OleDbComm and("SELECT * from tblAssets where
>>>>asset_tag=? ",
>>>>Con)
>>>>
>>>>assCmd.Para meters.Add("ass et_tag", OleDbType.VarCh ar).Value =
>>>>cboAsset.Te xt
>>>>
>>>>Dim assDT As New DataTable
>>>>
>>>>'Need to initialize the dataAdapter here
>>>>
>>>>'Release the instances of the above objects
>>>>
>>>>assAdapter. Fill(assDT)
>>>>
>>>>'assAdapter .Dispose()
>>>>
>>>>Me.DataGrid View1.DataSourc e = assDT
>>>>
>>>>End If
>>>>
>>>>
>>>>
>>>>"Jack Jackson" <jjackson@cinno vations.netwrot e in message
>>>>news:f67c84 lj9a92i4ds6rk7v rbnpa0f517mn5@4 ax.com...
>>>>You specify the connection in the command object.
>>>>>
>>>>assCmd = New OleDb.OleDbComm and( _
>>>> "SELECT * from tblAssets where asset_tag=?", Con)
>>>>assAdapte r = New OleDbAdapter(as sCmd)
>>>>>
>>>>or
>>>>assCmd = ...
>>>>Dim assAdapter as New OleDbAdapter
>>>>assAdapter. SelectCommand = assCmd
>>>>>
>>>>>
>>>>On Mon, 21 Jul 2008 23:05:29 -0600, "bill" <bill@bottlegar den.com>
>>>>wrote:
>>>>>
>>>>>>Sorry I see where you were going with that and you are right. It
>>>>>>works
>>>>>>like
>>>>>>this:
>>>>>>assAdapte r = New OleDb.OleDbData Adapter '(assCmd, Con)
>>>>>>
>>>>>>What I don't see in the properties now is how to add the command and
>>>>>>the
>>>>>>connectio n to the dataAdapter. Can you help me there since you've
>>>>>>almost
>>>>>>done it all now? :)
>>>>>>
>>>>>>Thank you!
>>>>>>
>>>>>>"bill"<bi ll@bottlegarden .comwrote in message
>>>>>>news:OhRK 3f76IHA.5012@TK 2MSFTNGP02.phx. gbl...
>>>>>>It's still the assAdapter that errors out in this. It's not
>>>>>>declare d
>>>>>>anywher e else so I just don't see why this is happening. If i take
>>>>>>out
>>>>>>the first declaration there are even more errors that come up.
>>>>>>>
>>>>>>"Jack Jackson" <jjackson@cinno vations.netwrot e in message
>>>>>>news:b5pa 849kcqoh9e6m74c 43r8866noafne1a @4ax.com...
>>>>>>>This is exactly the same problem you had in the previous example.
>>>>>>>>
>>>>>>>Either remove the first Dim (the best solution), or change the
>>>>>>>second
>>>>>>>one to just an assignment statement:
>>>>>>>>
>>>>>>> assCmd = New OleDb.OleDbComm and( _
>>>>>>> "SELECT * from tblAssets where asset_tag=?")
>>>>>>>>
>>>>>>>On Mon, 21 Jul 2008 22:24:14 -0600, "bill" <bill@bottlegar den.com>
>>>>>>>wrote:
>>>>>>>>
>>>>>>>>>Does anyone see why I'm getting this message? It errors out on
>>>>>>>>>line 5
>>>>>>>>>at
>>>>>>>>>"assAd apter"?
>>>>>>>>>Dim Con = New
>>>>>>>>>OleDb. OleDbConnection ("provider=micr osoft.jet.oledb .4.0;"
>>>>>>>>>&
>>>>>>>>>"dat a source=c:\_Arch ive\Documentati on - Projects\Hardwa re
>>>>>>>>>Tracki ng -
>>>>>>>>>2008\I T_Assets.mdb")
>>>>>>>>>
>>>>>>>>>Dim assAdapter As OleDb.OleDbData Adapter
>>>>>>>>>
>>>>>>>>>Dim assCmd As New OleDb.OleDbComm and("SELECT * from tblAssets where
>>>>>>>>>asset_ tag=?")
>>>>>>>>>
>>>>>>>>>assCmd .Parameters.Add ("asset_tag" , OleDbType.VarCh ar).Value =
>>>>>>>>>cboAss et.Text
>>>>>>>>>
>>>>>>>>>Dim assAdapter As New OleDb.OleDbData Adapter(assCmd, Con)
>>>>>>>>>
>>>>>>>>>Dim assDT As New DataTable
>>>>>>>>>
>>>>>>>>>'Relea se the instances of the above objects
>>>>>>>>>
>>>>>>>>>assAda pter.Fill(assDT )
>>>>>>>>>
>>>>>>>>>assAda pter.Dispose()
>>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>
>>which is built from the text you pass to the DataAdapter's
>>constructor , doesn't have any connection info.
>>>
>>See my comments below.
>>>
>>>>assCmd = New OleDb.OleDbComm and( _
>>>> "SELECT * from tblAssets where asset_tag=?", Con)
>>>>assAdapte r = New OleDbAdapter(as sCmd)
>>>
>>On Tue, 22 Jul 2008 18:05:09 -0600, "bill" <bill@bottlegar den.com>
>>wrote:
>>>
>>>>Thank you again! That got it:) Though there is more now.... I get an
>>>>error
>>>>at "assAdapter.fil l(assDT)" that says "fill: SelectCommand.C onnection
>>>>property has not been initialized? Do you see why?
>>>>Dim Con = New OleDb.OleDbConn ection("provide r=microsoft.jet .oledb.4.0;"
>>>>&
>>>>"data source=c:\_Arch ive\Documentati on - Projects\Hardwa re Tracking -
>>>>2008\IT_Ass ets.mdb")
>>>
>>The following line creates an OleDbCommand without a connection
>>object.
>>>
>>>>Dim assCmd As New OleDb.OleDbComm and("SELECT * from tblAssets where
>>>>asset_tag=? ")
>>>>
>>>>Dim assAdapter As OleDb.OleDbData Adapter
>>>
>>The following line creates a DataAdapter from the OleDbCommand object
>>that doesn't have a connection object.
>>>
>>>>assAdapte r = New OleDb.OleDbData Adapter(assCmd)
>>>>
>>>>'Dim assCmd As OleDb.OleDbComm and
>>>
>>The following line creates a second command object with the same
>>select as the previous one, this time with a connection object. This
>>command object is never used. You should get rid of this line, and
>>add Con as a second parameter to the previous OleDbCommand.
>>>
>>>>assCmd = New OleDb.OleDbComm and("SELECT * from tblAssets where
>>>>asset_tag=? ",
>>>>Con)
>>>>
>>>>assCmd.Para meters.Add("ass et_tag", OleDbType.VarCh ar).Value =
>>>>cboAsset.Te xt
>>>>
>>>>Dim assDT As New DataTable
>>>>
>>>>'Need to initialize the dataAdapter here
>>>>
>>>>'Release the instances of the above objects
>>>>
>>>>assAdapter. Fill(assDT)
>>>>
>>>>'assAdapter .Dispose()
>>>>
>>>>Me.DataGrid View1.DataSourc e = assDT
>>>>
>>>>End If
>>>>
>>>>
>>>>
>>>>"Jack Jackson" <jjackson@cinno vations.netwrot e in message
>>>>news:f67c84 lj9a92i4ds6rk7v rbnpa0f517mn5@4 ax.com...
>>>>You specify the connection in the command object.
>>>>>
>>>>assCmd = New OleDb.OleDbComm and( _
>>>> "SELECT * from tblAssets where asset_tag=?", Con)
>>>>assAdapte r = New OleDbAdapter(as sCmd)
>>>>>
>>>>or
>>>>assCmd = ...
>>>>Dim assAdapter as New OleDbAdapter
>>>>assAdapter. SelectCommand = assCmd
>>>>>
>>>>>
>>>>On Mon, 21 Jul 2008 23:05:29 -0600, "bill" <bill@bottlegar den.com>
>>>>wrote:
>>>>>
>>>>>>Sorry I see where you were going with that and you are right. It
>>>>>>works
>>>>>>like
>>>>>>this:
>>>>>>assAdapte r = New OleDb.OleDbData Adapter '(assCmd, Con)
>>>>>>
>>>>>>What I don't see in the properties now is how to add the command and
>>>>>>the
>>>>>>connectio n to the dataAdapter. Can you help me there since you've
>>>>>>almost
>>>>>>done it all now? :)
>>>>>>
>>>>>>Thank you!
>>>>>>
>>>>>>"bill"<bi ll@bottlegarden .comwrote in message
>>>>>>news:OhRK 3f76IHA.5012@TK 2MSFTNGP02.phx. gbl...
>>>>>>It's still the assAdapter that errors out in this. It's not
>>>>>>declare d
>>>>>>anywher e else so I just don't see why this is happening. If i take
>>>>>>out
>>>>>>the first declaration there are even more errors that come up.
>>>>>>>
>>>>>>"Jack Jackson" <jjackson@cinno vations.netwrot e in message
>>>>>>news:b5pa 849kcqoh9e6m74c 43r8866noafne1a @4ax.com...
>>>>>>>This is exactly the same problem you had in the previous example.
>>>>>>>>
>>>>>>>Either remove the first Dim (the best solution), or change the
>>>>>>>second
>>>>>>>one to just an assignment statement:
>>>>>>>>
>>>>>>> assCmd = New OleDb.OleDbComm and( _
>>>>>>> "SELECT * from tblAssets where asset_tag=?")
>>>>>>>>
>>>>>>>On Mon, 21 Jul 2008 22:24:14 -0600, "bill" <bill@bottlegar den.com>
>>>>>>>wrote:
>>>>>>>>
>>>>>>>>>Does anyone see why I'm getting this message? It errors out on
>>>>>>>>>line 5
>>>>>>>>>at
>>>>>>>>>"assAd apter"?
>>>>>>>>>Dim Con = New
>>>>>>>>>OleDb. OleDbConnection ("provider=micr osoft.jet.oledb .4.0;"
>>>>>>>>>&
>>>>>>>>>"dat a source=c:\_Arch ive\Documentati on - Projects\Hardwa re
>>>>>>>>>Tracki ng -
>>>>>>>>>2008\I T_Assets.mdb")
>>>>>>>>>
>>>>>>>>>Dim assAdapter As OleDb.OleDbData Adapter
>>>>>>>>>
>>>>>>>>>Dim assCmd As New OleDb.OleDbComm and("SELECT * from tblAssets where
>>>>>>>>>asset_ tag=?")
>>>>>>>>>
>>>>>>>>>assCmd .Parameters.Add ("asset_tag" , OleDbType.VarCh ar).Value =
>>>>>>>>>cboAss et.Text
>>>>>>>>>
>>>>>>>>>Dim assAdapter As New OleDb.OleDbData Adapter(assCmd, Con)
>>>>>>>>>
>>>>>>>>>Dim assDT As New DataTable
>>>>>>>>>
>>>>>>>>>'Relea se the instances of the above objects
>>>>>>>>>
>>>>>>>>>assAda pter.Fill(assDT )
>>>>>>>>>
>>>>>>>>>assAda pter.Dispose()
>>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>
>>
>
Leave a comment: