Go Back   Forum Care Forums > Development Reference Area > Visual Basic

Reply
 
LinkBack Thread Tools Display Modes
Access .mdb and VB
Old
  (#1)
DL
Guest
 
Posts: n/a
Default Access .mdb and VB - 06-04-2007, 09:48 AM

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...


   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Re: Access .mdb and VB
Old
  (#2)
Veign
Guest
 
Posts: n/a
Default Re: Access .mdb and VB - 06-04-2007, 09:48 AM

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" <EMAIL REMOVED> wrote in message
news:412e6a16$0$42410$EMAIL REMOVED...
> 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...
>
>



   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: Access .mdb and VB
Old
  (#3)
arko
Guest
 
Posts: n/a
Default Re: Access .mdb and VB - 06-04-2007, 09:48 AM

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 ***word")

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" <EMAIL REMOVED> schreef in bericht
news:412e6a16$0$42410$EMAIL REMOVED...
> 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...
>
>



   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: Access .mdb and VB
Old
  (#4)
Hal Rosser
Guest
 
Posts: n/a
Default Re: Access .mdb and VB - 06-04-2007, 09:48 AM

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" <EMAIL REMOVED> wrote in message
news:412e6a16$0$42410$EMAIL REMOVED...
> 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


   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: Access .mdb and VB
Old
  (#5)
M. Posseth
Guest
 
Posts: n/a
Default Re: Access .mdb and VB - 06-04-2007, 09:49 AM

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" <EMAIL REMOVED> wrote in message
news:5QQXc.46654$_EMAIL REMOVED.. .
> 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" <EMAIL REMOVED> wrote in message
> news:412e6a16$0$42410$EMAIL REMOVED...
> > 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
>
>



   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: Access .mdb and VB
Old
  (#6)
Hal Rosser
Guest
 
Posts: n/a
Default Re: Access .mdb and VB - 06-04-2007, 09:49 AM


"M. Posseth" <EMAIL REMOVED> wrote in message
news:cgqpa5$bsa$EMAIL REMOVED...
> 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


   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: Access .mdb and VB
Old
  (#7)
mickey
Guest
 
Posts: n/a
Default Re: Access .mdb and VB - 06-04-2007, 09:49 AM

On Fri, 27 Aug 2004 19:30:01 +0200, "arko" <EMAIL REMOVED> 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 ***word")
>
>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 ####
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Contact Us - Forum Care Forums - Archive - Top