From: bill on
Does anyone see why I'm getting this message? It errors out on line 5 at
"assAdapter"?
Dim Con = New OleDb.OleDbConnection("provider=microsoft.jet.oledb.4.0;" &
"data source=c:\_Archive\Documentation - Projects\Hardware Tracking -
2008\IT_Assets.mdb")

Dim assAdapter As OleDb.OleDbDataAdapter

Dim assCmd As New OleDb.OleDbCommand("SELECT * from tblAssets where
asset_tag=?")

assCmd.Parameters.Add("asset_tag", OleDbType.VarChar).Value = cboAsset.Text

Dim assAdapter As New OleDb.OleDbDataAdapter(assCmd, Con)

Dim assDT As New DataTable

'Release the instances of the above objects

assAdapter.Fill(assDT)

assAdapter.Dispose()


From: Jack Jackson on
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.OleDbCommand( _
"SELECT * from tblAssets where asset_tag=?")

On Mon, 21 Jul 2008 22:24:14 -0600, "bill" <bill(a)bottlegarden.com>
wrote:

>Does anyone see why I'm getting this message? It errors out on line 5 at
>"assAdapter"?
>Dim Con = New OleDb.OleDbConnection("provider=microsoft.jet.oledb.4.0;" &
>"data source=c:\_Archive\Documentation - Projects\Hardware Tracking -
>2008\IT_Assets.mdb")
>
>Dim assAdapter As OleDb.OleDbDataAdapter
>
>Dim assCmd As New OleDb.OleDbCommand("SELECT * from tblAssets where
>asset_tag=?")
>
>assCmd.Parameters.Add("asset_tag", OleDbType.VarChar).Value = cboAsset.Text
>
>Dim assAdapter As New OleDb.OleDbDataAdapter(assCmd, Con)
>
>Dim assDT As New DataTable
>
>'Release the instances of the above objects
>
>assAdapter.Fill(assDT)
>
>assAdapter.Dispose()
>
From: bill on
It's still the assAdapter that errors out in this. It's not declared
anywhere 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(a)cinnovations.net> wrote in message
news:b5pa849kcqoh9e6m74c43r8866noafne1a(a)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.OleDbCommand( _
> "SELECT * from tblAssets where asset_tag=?")
>
> On Mon, 21 Jul 2008 22:24:14 -0600, "bill" <bill(a)bottlegarden.com>
> wrote:
>
>>Does anyone see why I'm getting this message? It errors out on line 5 at
>>"assAdapter"?
>>Dim Con = New OleDb.OleDbConnection("provider=microsoft.jet.oledb.4.0;" &
>>"data source=c:\_Archive\Documentation - Projects\Hardware Tracking -
>>2008\IT_Assets.mdb")
>>
>>Dim assAdapter As OleDb.OleDbDataAdapter
>>
>>Dim assCmd As New OleDb.OleDbCommand("SELECT * from tblAssets where
>>asset_tag=?")
>>
>>assCmd.Parameters.Add("asset_tag", OleDbType.VarChar).Value =
>>cboAsset.Text
>>
>>Dim assAdapter As New OleDb.OleDbDataAdapter(assCmd, Con)
>>
>>Dim assDT As New DataTable
>>
>>'Release the instances of the above objects
>>
>>assAdapter.Fill(assDT)
>>
>>assAdapter.Dispose()
>>


From: bill on
Sorry I see where you were going with that and you are right. It works like
this:
assAdapter = New OleDb.OleDbDataAdapter '(assCmd, Con)

What I don't see in the properties now is how to add the command and the
connection to the dataAdapter. Can you help me there since you've almost
done it all now? :)

Thank you!

"bill"<bill(a)bottlegarden.com> wrote in message
news:OhRK3f76IHA.5012(a)TK2MSFTNGP02.phx.gbl...
> It's still the assAdapter that errors out in this. It's not declared
> anywhere 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(a)cinnovations.net> wrote in message
> news:b5pa849kcqoh9e6m74c43r8866noafne1a(a)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.OleDbCommand( _
>> "SELECT * from tblAssets where asset_tag=?")
>>
>> On Mon, 21 Jul 2008 22:24:14 -0600, "bill" <bill(a)bottlegarden.com>
>> wrote:
>>
>>>Does anyone see why I'm getting this message? It errors out on line 5 at
>>>"assAdapter"?
>>>Dim Con = New OleDb.OleDbConnection("provider=microsoft.jet.oledb.4.0;" &
>>>"data source=c:\_Archive\Documentation - Projects\Hardware Tracking -
>>>2008\IT_Assets.mdb")
>>>
>>>Dim assAdapter As OleDb.OleDbDataAdapter
>>>
>>>Dim assCmd As New OleDb.OleDbCommand("SELECT * from tblAssets where
>>>asset_tag=?")
>>>
>>>assCmd.Parameters.Add("asset_tag", OleDbType.VarChar).Value =
>>>cboAsset.Text
>>>
>>>Dim assAdapter As New OleDb.OleDbDataAdapter(assCmd, Con)
>>>
>>>Dim assDT As New DataTable
>>>
>>>'Release the instances of the above objects
>>>
>>>assAdapter.Fill(assDT)
>>>
>>>assAdapter.Dispose()
>>>
>
>


From: Jack Jackson on
You specify the connection in the command object.

assCmd = New OleDb.OleDbCommand( _
"SELECT * from tblAssets where asset_tag=?", Con)
assAdapter = New OleDbAdapter(assCmd)

or
assCmd = ...
Dim assAdapter as New OleDbAdapter
assAdapter.SelectCommand = assCmd


On Mon, 21 Jul 2008 23:05:29 -0600, "bill" <bill(a)bottlegarden.com>
wrote:

>Sorry I see where you were going with that and you are right. It works like
>this:
>assAdapter = New OleDb.OleDbDataAdapter '(assCmd, Con)
>
>What I don't see in the properties now is how to add the command and the
>connection to the dataAdapter. Can you help me there since you've almost
>done it all now? :)
>
>Thank you!
>
>"bill"<bill(a)bottlegarden.com> wrote in message
>news:OhRK3f76IHA.5012(a)TK2MSFTNGP02.phx.gbl...
>> It's still the assAdapter that errors out in this. It's not declared
>> anywhere 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(a)cinnovations.net> wrote in message
>> news:b5pa849kcqoh9e6m74c43r8866noafne1a(a)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.OleDbCommand( _
>>> "SELECT * from tblAssets where asset_tag=?")
>>>
>>> On Mon, 21 Jul 2008 22:24:14 -0600, "bill" <bill(a)bottlegarden.com>
>>> wrote:
>>>
>>>>Does anyone see why I'm getting this message? It errors out on line 5 at
>>>>"assAdapter"?
>>>>Dim Con = New OleDb.OleDbConnection("provider=microsoft.jet.oledb.4.0;" &
>>>>"data source=c:\_Archive\Documentation - Projects\Hardware Tracking -
>>>>2008\IT_Assets.mdb")
>>>>
>>>>Dim assAdapter As OleDb.OleDbDataAdapter
>>>>
>>>>Dim assCmd As New OleDb.OleDbCommand("SELECT * from tblAssets where
>>>>asset_tag=?")
>>>>
>>>>assCmd.Parameters.Add("asset_tag", OleDbType.VarChar).Value =
>>>>cboAsset.Text
>>>>
>>>>Dim assAdapter As New OleDb.OleDbDataAdapter(assCmd, Con)
>>>>
>>>>Dim assDT As New DataTable
>>>>
>>>>'Release the instances of the above objects
>>>>
>>>>assAdapter.Fill(assDT)
>>>>
>>>>assAdapter.Dispose()
>>>>
>>
>>
>