Wrox Programmer Forums
|
VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Databases Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 1st, 2004, 03:22 PM
Registered User
 
Join Date: Jul 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help me with VB data link

I use MS Access as my database (do not have SQL Server). I use ODBC to create DSN, open VB and select Standard Exe from New Project dialog, select View|Data View Window to open up Data View, right click on Data Links and select Add a Data Link, select either Microsoft OLE DB Provider for ODBC Drivers or Microsoft Jet 4.0 OLE DB Provider, and set up the connection.
When I try to open the Data link node I've just created in order to add new tables, I get this error message "Unable to establish a connection. Please ensure that the connection properties are correct and that the source is availabel. ActiveX component can't create object"
My friend does samething that I did on his machine and has no problem. There must be something wrong with my VB setting, is it right? Please help me.
Thank you for your response

Mai Nguyen

 
Old July 30th, 2004, 08:14 AM
Authorized User
 
Join Date: Jul 2004
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Use the connect string below, no DSN needed.
replace the MDB with the actual path and file name.

make sure you have Miscrosoft ADO 2.5 or greater in your project references.

oConn.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
           "Dbq=c:\somepath\mydb.mdb;" & _
           "Uid=admin;" & _
           "Pwd="

look at

http://www.able-consulting.com/ADO_Conn.htm





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to link FoxPro Table with VB achour Pro VB Databases 2 September 14th, 2009 09:26 AM
VB n Word helpful link abdul_wasie VB How-To 1 May 10th, 2005 02:25 PM
How to link ASP.NET and VB application ractim General .NET 1 August 16th, 2004 08:14 AM
How to make vb form link? abdusalam Pro VB Databases 1 July 8th, 2004 06:18 AM
How to make vb form link (short cut)? abdusalam VB How-To 7 June 25th, 2004 09:50 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.