English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

In the book of VB6, examples are there to connect the sample databases supplied with the Access/VB using data control which works fine while I practice. But while trying to attach my own database created by Access 2000 by data control, it says "Unrecognised database format". How to get the connection?

2007-05-26 02:14:27 · 3 answers · asked by The Dumb Head 2 in Computers & Internet Programming & Design

3 answers

You'll need to use ADO to connect to an Access2000 mdb. There's an ADO control or you can do it in code. Here's smple code to get you started:

Dim Db as Connection
Dim SQLStatement as String

Set Db = New Connection
Db.CursorLocation = adUseClient
Db.Open gDSN
SQLStatement = "Select ..."
Set adoSalesPerson = New Recordset
adoSalesPerson.Open SQLStatement, Db, adOpenStatic, adLockOptimistic
If adoSalesPerson.RecordCount > 0 Then

2007-05-26 04:27:28 · answer #1 · answered by rod 6 · 0 0

I may be wrong, but from memory, youcan only use Access97 database with VB6, I heard of an update or patch for it to work with Access2000, or even using newer ODBC drivers, but never tried.

2007-05-26 02:17:17 · answer #2 · answered by Cupcake 7 · 0 0

the 1st answer years in the past replaced into 'particular', considering you need to in simple terms use your get right of entry to to equipment the utility and distribute it to purchasers. effective and neat. The purchasers, including your self, ought to in no way alter the database, in user-friendly terms the information it contained. yet you saved a replica pre-convey jointly, so it worked properly. Then the respond replaced into 'no' considering you have been next allowed to distribute the run time information of get right of entry to. regrettably via a delicate over sight, in the adventure that your purchasers already had get right of entry to onboard and those distribution information have been a distinctive version, they forgot to envision and in simple terms over wrote each thing. that's a mistake absolutely everyone could make, extremely uncomplicated to make if MS forget approximately to objective their utility in the past advertising it to you. Now the respond you will see maximum frequently instructed over the internet is 'it may't be accomplished anymore'. properly those solutions are incorrect. that's genuine which you will no longer create the executable anymore nor are you able to over wright your purchasers put in get right of entry to runtime information. rather you have a plenty greater handy way. Make your get right of entry to information information a source on top of issues PanelAdministrative strategies information materials. in all hazard on your case a consumer DSN. the marriage for this on your VB code could no longer be a sweeter one. be conscious, Excel and get right of entry to will %. up each and all the counsel their want rapidly from the ODBC. or you could interface making use of your code. i think of that's relatively neat, the undertaking I had with it replaced into that i did no longer comprehend how lots of the paintings replaced into accomplished for you, so i replaced into attempting to apply code to do issues that have been geared up in.

2016-11-05 11:00:37 · answer #3 · answered by ? 4 · 0 0

fedest.com, questions and answers