Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems retrieving table names with DAO (VB6.0) and Access 2000 1

Status
Not open for further replies.

bassplayer

Programmer
May 17, 2000
7
0
0
US
When I add the DAO Data control to a form and try to pull up the RecordSource after I add the DatabaseName, it returns a messagebox with "Unrecognized Database format".  I'm using VB 6.0 and Access 2000.  Please help!!
 
Why not use ADO , I know DAO is fast, but you can only do one connection at a time, and other than that I dont know much about DAO, but I know alot more people use ADO, especially when it comes to VB, and ASP(VBscript). Would&nbsp;&nbsp;you like to know more? <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML, ASP(somewhat), QBasic(least i didnt start with COBOL)
 
I'm just learning about this response thing......<br><br>Thanks kb244.&nbsp;&nbsp;I'm working on a project for school....Villa Julie's ATEC Center....and want to attempt to use DAO in my project...I'm understanding that there is an inherant problem with VB 6.0 and Access 2000 when it comes to DAO.<br><br>Thanks paveway.&nbsp;&nbsp;I tried the code and followed the instructions but I'm still getting the same Error message.&nbsp;&nbsp;I'll keep playing with it while I try not to pull my hair out!&nbsp;&nbsp;Thanks again!<br><br>
 
Yes, what kb244 told was correct. we need to use the ADO control and try the connection property by right clicking . Once the connection is successful the database from Access2000 will be cleared.I have experienced the same and came sucessfuly.
 
Thanks vbsath20!&nbsp;&nbsp;I'm trying that now but still having difficulties.....is there specific code I need to access the DB?&nbsp;&nbsp;I'm having problems connecting to my .mdb<br>I'd appreciate any help!!
 
if it doesnt hurt ya, can we see a segment of your code? <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML, ASP(somewhat), QBasic(least i didnt start with COBOL)
 
Just a thought - when you are using Access 2000 you have to have the latest Microsoft Data Access Objects installed.&nbsp;&nbsp;You can download these from the Microsoft web site MDAC_Typ2.5.exe or something similar.&nbsp;&nbsp;Goto <A HREF=" TARGET="_new"> and follow the links to the 2.5 type library.
 
Thanks Gettoblaster.....I'll try it later tonight!<br><br>kb244....I haven't been on in a while....I'll get code here soon...I'm going to try the patch first...I've been hearing of this inherent problem with Access 2000 and VB 6.0....so one thing at a time.&nbsp;&nbsp;Any code I've been using is from class (Villa Julie's ATEC Center) or VB Programming books from WROX.&nbsp;&nbsp;Thanks!
 
In Access&nbsp;&nbsp;store the database in the previous format and try to open it in VB . Good luck. <p>Henry Drillich<br><a href=mailto:drillich@tpgi.com.au>drillich@tpgi.com.au</a><br><a href= > </a><br>
 
For ADO (or the ADO Data Control), use the &quot;Microsoft.Jet.OLEDB.4.0&quot; provider. <br>For DAO, go to Project menu, and choose References to use the &quot;Microsoft DAO 3.6 Object Library.&quot; <br>If you use the generic Data-Control, you need to open a DAO 3.6 recordset and then assign it to be the source of the Data Control as follows: <br>Option Explicit<br>Private daoDB36 As Database<br>Private rs As DAO.Recordset<br>Dim sPath As String<br><br>Private Sub Form_Load()<br>sPath = _<br>&quot;C:\Program Files\Microsoft Office\Office\Samples\Northwind.mdb&quot;<br>Set daoDB36 = DBEngine(0).OpenDatabase(sPath)<br>Set rs = daoDB36.OpenRecordset(&quot;Customers&quot;)<br>Set Data1.Recordset = rs<br>End Sub <br><br>put textbox on the form and set the <br>datasource-&gt;data1<br>write in the datafeild property the name of your filed<br>datafield-&gt;CustomersName<br>
 
Thanks, but I still get the &quot;Unrecognizable Database Format&quot; prompt when I try to retrieve my project as opposed to Northwind.&nbsp;&nbsp;Northiwind works fine.&nbsp;&nbsp;I give up at this point.&nbsp;&nbsp;I've tried all the suggestions given so far.&nbsp;&nbsp;My project is due next week and I won't have time to play with this at the last minute.&nbsp;&nbsp;I'm just going to use ADO.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top