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

Access .mdb and VB

DL
Hi,

Is it possible to use an access .mdb database file as a database?
If so then how do I connect to it? (and make a sample query)
I know you can add something in controlpanel>systemsettings > ODBC
but I haven't got a clue what to do next.....
I don't even know if this would be the right way to do it.

Thank you in advance...
Jul 17 '05 #1
6 13971
Do a search on Google for 'ADO VB Access'

Some Links:
VB Database Programming:
http://www.vbexplorer.com/VBExplorer...er_ADO_DAO.asp
http://www.vb-helper.com/ado_talk.htm
--
Chris Hanscom
MVP (Visual Basic)
http://www.veign.com
--

"DL" <da*******@hotmail.com> wrote in message
news:41**********************@news.wanadoo.nl...
Hi,

Is it possible to use an access .mdb database file as a database?
If so then how do I connect to it? (and make a sample query)
I know you can add something in controlpanel>systemsettings > ODBC
but I haven't got a clue what to do next.....
I don't even know if this would be the right way to do it.

Thank you in advance...

Jul 17 '05 #2
the dao way:

add a reference to dao
dim db as database
dim dtsql as recordset

set db=opendatabase("database.mdb",false,false,";pwd=p assword")

set dtsql=db.openrecordset("select * from [table];",dbopendynaset)
dtsql.movefirst
do while not dtsql.eof
list1.additem dtsql![fieldname]
dtsql.movenext
loop
dtsql.close
set dtsql=nothing
set db=nothing

"DL" <da*******@hotmail.com> schreef in bericht
news:41**********************@news.wanadoo.nl...
Hi,

Is it possible to use an access .mdb database file as a database?
If so then how do I connect to it? (and make a sample query)
I know you can add something in controlpanel>systemsettings > ODBC
but I haven't got a clue what to do next.....
I don't even know if this would be the right way to do it.

Thank you in advance...

Jul 17 '05 #3
You can use the DAO data control, or the ADO data control, or code
A decent text will walk you through it - too much for one little post

"DL" <da*******@hotmail.com> wrote in message
news:41**********************@news.wanadoo.nl...
Hi,

Is it possible to use an access .mdb database file as a database?
If so then how do I connect to it? (and make a sample query)
I know you can add something in controlpanel>systemsettings > ODBC
but I haven't got a clue what to do next.....
I don't even know if this would be the right way to do it.

Thank you in advance...

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.744 / Virus Database: 496 - Release Date: 8/24/2004
Jul 17 '05 #4
Well as DAO is considered as obsolete , (you should only use it for
maintenance on old progs )
you should sure investigate ADO

take a look at www.freevbcode.com for some examples


"Hal Rosser" <hm******@bellsouth.net> wrote in message
news:5Q******************@bignews3.bellsouth.net.. .
You can use the DAO data control, or the ADO data control, or code
A decent text will walk you through it - too much for one little post

"DL" <da*******@hotmail.com> wrote in message
news:41**********************@news.wanadoo.nl...
Hi,

Is it possible to use an access .mdb database file as a database?
If so then how do I connect to it? (and make a sample query)
I know you can add something in controlpanel>systemsettings > ODBC
but I haven't got a clue what to do next.....
I don't even know if this would be the right way to do it.

Thank you in advance...

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.744 / Virus Database: 496 - Release Date: 8/24/2004

Jul 17 '05 #5

"M. Posseth" <mi*****@nohausystems.nl> wrote in message
news:cg**********@reader13.wxs.nl...
Well as DAO is considered as obsolete , (you should only use it for
maintenance on old progs )
you should sure investigate ADO

well, ADO is obsolete also (replaced by ADO.NET)
good point - but since VB6.0 is also considered obsolete - and considering
that DAO works great with access, then why not
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.744 / Virus Database: 496 - Release Date: 8/24/2004
Jul 17 '05 #6
On Fri, 27 Aug 2004 19:30:01 +0200, "arko" <ar**@arko.nl> you typed
some letters in random order:
the dao way:

add a reference to dao
dim db as database
dim dtsql as recordset

set db=opendatabase("database.mdb",false,false,";pwd=p assword")

set dtsql=db.openrecordset("select * from [table];",dbopendynaset)
I go like this:
set qd = db.createquerydef("","select blabla")
set rs = qd.openrecordset

But your code is as eyeopener to me

Your code must be more efficient couse there is no query created.
Is this true ?
dtsql.movefirst
do while not dtsql.eof
list1.additem dtsql![fieldname]
dtsql.movenext
loop
dtsql.close
set dtsql=nothing
set db=nothing


Thanx
Groetjenz,

Mickey
--
#### gewoan skrieve su ast ut seist ####
Jul 17 '05 #7

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

Similar topics

63
by: Jerome | last post by:
Hi, I'm a bit confused ... when would I rather write an database application using MS Access and Visual Basic and when (and why) would I rather write it using Visual Studio .Net? Is it as easy...
13
by: bill | last post by:
I am trying to convince a client that dotNet is preferable to an Access project (ADP/ADE). This client currently has a large, pure Access MDB solution with 30+ users, which needs to be upgraded....
1
by: Dave | last post by:
Hello NG, Regarding access-declarations and member using-declarations as used to change the access level of an inherited base member... Two things need to be considered when determining an...
13
by: Simon Bailey | last post by:
I am a newcomer to databases and am not sure which DBMS to use. I have a very simplified knowledge of databases overall. I would very much appreciate a (simplifed) message explaining the advantages...
20
by: Olav.NET | last post by:
I am a .NET/C++ developer who is supposed to do some work with Access. I do not know much about it except for the DB part. Questions: *1* I am looking for INTENSIVE books to get quickly up to...
64
by: John | last post by:
Hi What future does access have after the release of vs 2005/sql 2005? MS doesn't seem to have done anything major with access lately and presumably hoping that everyone migrates to vs/sql. ...
1
by: com | last post by:
Extreme Web Reports 2005 - Soft30.com The wizard scans the specified MS Access database and records information such as report names, parameters and subqueries. ......
17
by: Mell via AccessMonster.com | last post by:
Is there a way to find out where an application was created from? i.e. - work or home i.e. - if application sits on a (work) server/network, the IT people know the application is sitting...
37
by: jasmith | last post by:
How will Access fair in a year? Two years? .... The new version of Access seems to service non programmers as a wizard interface to quickly create databases via a fancy wizard. Furthermore, why...
2
by: eitsubashkumars | last post by:
I have configured remote access VPN with local pool in ASA firewall however im accessing all the resources(my private network such as servers ) through Asa firewall after getting connected the VPN...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.