473,407 Members | 2,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

struggling vb6 enthusiast wants help

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.v b(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
Nov 21 '05 #1
1 1441
See your response on the other thread.

"ROBERT BEE" <BU****@FREEUK.COM> wrote in message
news:oO********************@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.v b(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

Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Martien van Wanrooij | last post by:
Some time ago I already posted a question about a site that consists of several pages where the visitor, on every page can answer one or two questions in order to fill out an intake for for an...
22
by: Stan | last post by:
Hey everyone, I've got a computer science class and we're working on C++. I am struggling with nested loops and have a really simple assignment, but I can't get it to run the loop. I need to run...
26
by: dagger | last post by:
Hi there. I'm using C under FreeBSD with the gcc compiler and am having a bit of trouble using the calloc and realloc calls. As an example the code snippet: #include <stdio.h> int main() {...
4
by: Angus Comber | last post by:
Hello I have received a lot of help on my little project here. Many thanks. I have a struct with a string and a long member. I have worked out how to qsort the struct on both members. I can...
8
by: Philip Colmer | last post by:
I'm rewriting some existing VBScript into VB.Net code. It was all going well until I hit the following error when testing the code: System.Runtime.InteropServices.COMException (0x80041003) at...
160
by: RG | last post by:
Greetings friends, This semester I have started a course in C programming. I was moving along fine until I reached to the topic of loops (feeling embarrassed among you elite programmers). My...
10
by: arnuld | last post by:
thanks
11
by: briankind | last post by:
Hello i have these radio buttons and i wish to have the corresponding textboxes to be visible when the radiobutton is selected. any Help? snippets. thanks thanks in adv Bry
1
by: Asanka | last post by:
I'm a Guitar enthusiast.. Recently, i found a new good website www.ebaysoho.com who sell many famouse guitars,like Gibson,Fender, Epiphone. All goods looks nice, so wonderful. IF interedted, please...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.