By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,290 Members | 1,666 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,290 IT Pros & Developers. It's quick & easy.

Access .mdb and VB

P: n/a
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
Share this Question
Share on Google+
6 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a

"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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.