Try this: change "Dim oConn As OleDbConnection" to "Dim oConn As
Sysem.Data.OleDb.OleDbConnection".
If your error goes away, then you add put "Imports System.Data.OleDb" at the
top of your CODE-BEHIND PAGE (the same page that has the "Dim oConn As
OleDbConnection" statement on it, not your HTML page.
[quoted text, click to view] "ROBERT BEE" <BUZZ15@FREEUK.COM> wrote in message
news:_-6dnUVztvF5hKbfRVnysg@pipex.net...
> Michael
>
> i think you have missed this as its included on the listing i
> provided......even i still get the 'not defined' error
>
>
>
> "Michael C#" <xyz@yomomma.com> wrote in message
> news:%23yuRF9zKFHA.2716@TK2MSFTNGP15.phx.gbl...
>> Oops sorry, didn't even realize you were coding ASP.NET. You might need
>> to Import the namespace I gave you on the code-behind page, however. Not
>> really sure though...
>>
>> Thanks
>>
>> "Michael C#" <xyz@yomomma.com> wrote in message
>> news:uA$eg4zKFHA.3512@TK2MSFTNGP15.phx.gbl...
>>> Add this line to the tip-top of your code:
>>>
>>> Imports System.Data.OleDb
>>>
>>>
>>> "ROBERT BEE" <BUZZ15@FREEUK.COM> wrote in message
>>> news:oOGdnXJhK6x6ZKTfRVnyjw@pipex.net...
>>>> Below is some code I have copied from the web with the intention of
>>>> modifying but I keep getting the stated errors. This is the umpteenth
>>>> attempt at trying to get
>>>> OleDbConnection,OleDbDataAdapter to work without any success. Do the
>>>> references have a hierarchy like in vb6 or is there something else I am
>>>> missing?
>>>>
>>>>
>>>>
>>>> Many Thanks in advance
>>>>
>>>> Buzz
>>>>
>>>>
>>>>
>>>> 'error
>>>>
>>>>
>>>> c:\inetpub\wwwroot\WebAppl tion6\WebForm1.aspx.vb(25): Type
>>>> 'OleDbDataAdapter' is not defined.
>>>> c:\inetpub\wwwroot\WebApplication6\WebForm1.aspx.vb(24): Type
>>>> 'OleDbConnection' is not defined.
>>>>
>>>> 'references
>>>>
>>>> ADOR
>>>> SYSTEM.DATA
>>>> SYSTEM.DRAWING
>>>> SYSTEM.WEB
>>>> SYSTEM.XML
>>>>
>>>> 'aspx page
>>>>
>>>> <%@ Import Namespace="System.Data" %>
>>>> <%@ Import Namespace="System.Data.OleDb" %>
>>>>
>>>>
>>>> 'code
>>>>
>>>> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
>>>> System.EventArgs) Handles MyBase.Load
>>>>
>>>> Dim oConn As OleDbConnection
>>>>
>>>> Dim oComm As OleDbDataAdapter
>>>>
>>>> Dim sConn As String
>>>>
>>>> Dim sComm As String
>>>>
>>>> Dim oDataSet As New DataSet
>>>>
>>>> 'Build the connection string
>>>>
>>>> sConn = "Provider=Microsoft.Jet.OLEDB.4.0;"
>>>>
>>>> sConn += "Data Source=C:\Inetpub\wwwroot\Sample\grocertogo.mdb;"
>>>>
>>>> sConn += "Persist Security Info=False"
>>>>
>>>> 'Build the SQL string sComm = "SELECT Products.ProductID, "
>>>>
>>>> sComm += "Products.ProductName, "
>>>>
>>>> sComm += "Products.ProductDescription, "
>>>>
>>>> sComm += "Products.UnitPrice "
>>>>
>>>> sComm += "FROM Products"
>>>>
>>>> 'Usually you would use error-handling here. It is left out to
>>>>
>>>> 'make the code as simple as possible.
>>>>
>>>> 'Create the connection and command objects
>>>>
>>>> oConn = New OleDbConnection(sConn)
>>>>
>>>> oComm = New OleDbDataAdapter(sComm, oConn)
>>>>
>>>> 'Fill the dataset with the results of the query
>>>>
>>>> oComm.Fill(oDataSet, "Products")
>>>>
>>>> End Sub
>>>>
>>>>
>>>
>>>
>>
>>
>
>