473,396 Members | 1,760 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,396 software developers and data experts.

MS Access - make connection - use class

Art
Hi -- I'm claiming once again that I'm new to this -- and I really am, it's just taking a long time to pick up what I need.

I'm reading through Dobson's book on VB.net and MS Access. I can connect to a database as follows:

Dim m_DB As New ADODB.Connection
Dim m_COB As New ADODB.Recordset

m_DB.Open("Provider=Microsoft.Jet.oledb.4.0;" & _
"Data Source=..\..\report1.mdb;", "Admin", "")

m_COB.ActiveConnection = m_DB
m_COB.Open("Delete * FROM T_Class", , _
ADODB.CursorTypeEnum.adOpenKeyset, _
ADODB.LockTypeEnum.adLockOptimistic)

I have a couple of questions.

First, I have no idea what the adOpenKeyset or adLockOptimistic means, I'm just copying them down. I'd appreciate any insight.

Second, I'd like to create a class with the skeletons of this stuff, for example...
m_DB.Open("Provider=Microsoft.Jet.oledb.4.0;" & _
"Data Source=..\..\report1.mdb;", "Admin", "")

I was thinking I could instantiate something like the m_DB by passing report1.mdb as a parameter. I can't figure out how to do this. I tried to create a class and inherit ADOB.connection -- this doesn't work. It tells me that I can only inherit from a class.

I realize that it's pretty obvious that I don't know what I'm doing, but I'm hoping that someone can clear up a few of these points for me.

Thanks,

Art
Nov 20 '05 #1
5 1189
Hi Art,

Do you have a library near you.

There is only one advice I can give you, try to get another book.

This is using classic VB in VB.net, not the best practice.

You would have to look at Ado.net (this is called classic ADO, the letters
looks the same however it is totally different)

Another approach can be to use the resource kit.

http://msdn.microsoft.com/vbasic/vbrkit/default.aspx

And if you have problems installing it

http://msdn.microsoft.com/vbasic/vbr...q/#installvdir

I hope this helps a little bit?

Cor
Nov 20 '05 #2
"Art" <ar*****@yahoo.com> schrieb
First, I have no idea what the adOpenKeyset or adLockOptimistic
means, I'm just copying them down. I'd appreciate any insight.

Here's the ADO documentation:
http://msdn.microsoft.com/library/en...dooverview.asp

CursorTypeEnum docs here:
http://msdn.microsoft.com/library/en...ortypeenum.asp

Both also available via <F1>.

Sorry, no answer to your 2nd question.

You could also consider using ADO.Net instead of unmanaged ADO.
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #3
Art
Cor

Thanks very much. After reading your note I went back to the book (since its title says VB.Net). It looks like Dobson may have started with the classic VB for those who were comfortable with classic VB but never used Access (I'm guessing). Anyway, it appears that further on he titles some chapters with ADO.Net

Until I read your note it didn't occur to me that there was something else to look forward to. I'll read ahead, it's probably better than continuing to proceed linearly through the book

What is the "resource kit"

Thanks

Art
Nov 20 '05 #4
Art
Armin

Thanks very much -- as you and Cor pointed out I'm not reading how to do this stuff using ADO.net -- something I wasn't aware of. Thanks for pointing it out and also for directing me to some documentation

Art
Nov 20 '05 #5
Hi Art,

It is a bunch of samples, lessons etc how to use VB.net, while there are
also free components in it.

It covers Windows, Adonet, Aspnet and compactframework.

I hope this clears it something?

Cor
Nov 20 '05 #6

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

Similar topics

1
by: James | last post by:
Hi, I am trying to access the MS Access database on my local machine in C# Windows Application in Visual Studio.NET. But it seems that it does not work. I use the Microsoft Application Blocks to...
0
by: Andrew Dowding | last post by:
Hi Everybody, I have been looking at problems with my Windows Forms C# application and it's little Jet 4 (Access) database for the last few days. The Windows Forms app implements a facade and...
4
by: Heath Kelly | last post by:
I need advice on correct usage of ADO.NET in an ASP.Net environment. I have an ASP.Net application that accesses data through a referenced class library. Things start to break down when multiple...
14
by: Nick Gilbert | last post by:
Hi, I have an asp.net application which runs from a CD-ROM using Cassini. As such, it is single user only. The application connects to an Access database when it is loaded, and keeps the same...
3
by: DwC | last post by:
Hi, We have a ms access database that we will be using to develop a website which would have fairly low usage levels. We have some experience with windows apps but not so much with asp.net...
17
by: Woody Splawn | last post by:
I am finding that time after time I have instances where I need to access information in a variable that is public. At the same time, the books I read say that one should not use public variables...
1
by: Anonymous via the Cypherpunks Tonga Remailer | last post by:
Hi, I'm building a simple Object Oriented CMS using PHP5 and the new object model (new to both). I'm looking for some design advice on how best to integrate the database class - which creates...
5
by: Nathan Given | last post by:
Hello All, I've been struggling on and off for 3 months trying to connect to an DB2 database running on an IBM iSeries machine. I FINALLY figured out how to connect with Coldfusion (see...
7
by: =?Utf-8?B?Um9nZWxpbw==?= | last post by:
hey, I have 2 threads, th and th2, both of them run a method. each of these 2 methods requires database access. sometimes I get an error, that database requires an open connection, and that...
1
by: dellis | last post by:
Problem: My project was initially created without putting passwords in the connection string. When I added the password in the connection string, it disappears when performing a database fill. I...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.