Hit Access 2.0 DB via ODBC (VB4) 
Author Message
 Hit Access 2.0 DB via ODBC (VB4)

I'm trying to write an app that may hit any of several backends... so
ODBC is the only route I can go. What I'd like to do is hit an Access
2.0 database in the interrim via ODBC for testing purposes, and while
I know this is possible, I can't seem to figure out how it's done...

Without going into too much detail, what do I need to do in order to
set up the ACC2.0 DB as the ODBC backend supporting the VB4
application?

Thanks in advance!

Phil Sauer



Sun, 01 Nov 1998 03:00:00 GMT  
 Hit Access 2.0 DB via ODBC (VB4)


Quote:

>I'm trying to write an app that may hit any of several backends... so
>ODBC is the only route I can go. What I'd like to do is hit an Access
>2.0 database in the interrim via ODBC for testing purposes, and while
>I know this is possible, I can't seem to figure out how it's done...

>Without going into too much detail, what do I need to do in order to
>set up the ACC2.0 DB as the ODBC backend supporting the VB4
>application?

>Thanks in advance!

>Phil Sauer


You can't do it. VB Supports Access directly but it doesn't let you do
it using ODBC. I have tried this in the past and never got it to work
and reading through the manuals, this is the answer I came up with. I
also just gave it a shot with VB 4 and Access 2 and it didn't work.

Luis



Mon, 02 Nov 1998 03:00:00 GMT  
 Hit Access 2.0 DB via ODBC (VB4)

You can use RDO in VB4 to talk to MS Access 7.0 using ODBC as a casual
read of the newsgroups will show.

It may also work for Access 2 as all you need is the appropriate ODBC
driver.

--
Philip Harvey
Project Manager
Business Development Ltd.



Tue, 03 Nov 1998 03:00:00 GMT  
 Hit Access 2.0 DB via ODBC (VB4)


 > >
 > >I'm trying to write an app that may hit any of several backends... so
 > >ODBC is the only route I can go. What I'd like to do is hit an Access
 > >2.0 database in the interrim via ODBC for testing purposes, and while
 > >I know this is possible, I can't seem to figure out how it's done...
 > >
 > >Without going into too much detail, what do I need to do in order to
 > >set up the ACC2.0 DB as the ODBC backend supporting the VB4
 > >application?
 > >
 > >Thanks in advance!
 > >
 > >Phil Sauer

 > >
 > >
 > >
 > You can't do it. VB Supports Access directly but it doesn't let you do
 > it using ODBC. I have tried this in the past and never got it to work
 > and reading through the manuals, this is the answer I came up with. I
 > also just gave it a shot with VB 4 and Access 2 and it didn't work.

 > Luis

I faked it by inspecting ODBC.INI to find what driver was being
used by the ODBC data source. If it turned out to be SIMBA.DLL or
ODBCJT16.DLL, then my program would open the database directly
after reading more information from ODBC.INI regarding the
database path and type. Otherwise, I could open it through ODBC.
Worked like a charm! No, I won't post or email the code.

--

WARNING: I cannot be held responsible for the above        They're   coming  to
because  my cats have  apparently  learned to type.        take me away, ha ha!



Tue, 03 Nov 1998 03:00:00 GMT  
 Hit Access 2.0 DB via ODBC (VB4)

Quote:


> >I'm trying to write an app that may hit any of several backends... so
> >ODBC is the only route I can go. What I'd like to do is hit an Access
> >2.0 database in the interrim via ODBC for testing purposes, and while
> >I know this is possible, I can't seem to figure out how it's done...
> >Without going into too much detail, what do I need to do in order to
> >set up the ACC2.0 DB as the ODBC backend supporting the VB4
> >application?
> >Thanks in advance!
> >Phil Sauer

> You can't do it. VB Supports Access directly but it doesn't let you do
> it using ODBC. I have tried this in the past and never got it to work
> and reading through the manuals, this is the answer I came up with. I
> also just gave it a shot with VB 4 and Access 2 and it didn't work.
> Luis

I, too, have come to this conclusion. To be strictly accurate, you
*can* access(!) access databases programatically via ODBC with vb4
(& vb3), but to do so you have to do it *all*, specifically with the
SQL functions & procedures exported by odbc32.dll (and, in 16 bits,
odbc.dll - they're identical, callwise). The ODBC SDK shows you how,
with a VB sample. Naturally this involves all the unpleasantness with
importing DLL interfaces via declare statements etc, but it isn't
*too* daunting.

But assuming that what was really intended by the question was 'is
it possible to open an access database via odbc using the DatabaseName
property of the data control, using an ODBC;DSN=whatever;UID=whoever
string in the way the parameter description for OpenDatabase says it
can be, so that you can abstract from the location of your .mdb file
by setting it up as an odbc data source?' - and the answer to this
question does seem to be no. Naturally the manuals and documentation
make no mention of this.

This is _really_ _terribly_ _annoying_.

I mean, what's the point of having odbc, and an odbc compliant database
like ms-access, and a rapid prototyping system like VB, if you can't use it?
All I need is for OpenDatabase to return me a VB Database object, using
that ODBC spec rather than a hardwired mdb filename (OK, so I can store that
in the registry and read it at run time, etc, etc) but I mean to say blah
blah blah how hard can it be blah blah blah? Mutter. Grumble.

Unless of course somebody knows different?

--
-------------------------------------------------------------------

BB 74 A4 EF 03 F8 44 C1 F3 75 FE C6 7E F9 6E 43         --- at home
-------------------------------------------------------------------



Wed, 04 Nov 1998 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Hit Access 2.0 DB via ODBC (VB4)

2. Problems accessing Access 2.0 via ODBC 2.x from VB3.0

3. VB4 access DB(MS-Access 2.0)

4. Accessing a secured Access 2.0 DB with VB4.0 16-bit

5. Using Access 2.0 via ODBC from VB

6. Secure Access 2.0 DB via VB-32bit

7. Accessing Access 2.0 database with VB3, ODBC 2.0 and Microsotf Jet Engine Compatibility Layer

8. VB3 using Access 2.0 db thru ODBC

9. Converting Access 2.0 DB to Access 97 DB in VB code

10. Access Oracle 7 DB on WinNT via ODBC

11. Access 2.0 Through Jet or ODBC w/ VB4?

12. VB4 to Access 2.0 through ODBC?

 

 
Powered by phpBB® Forum Software