Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
| Search | Today's Posts | Mark Forums Read
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To 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
  #1 (permalink)  
Old December 9th, 2006, 12:35 AM
Registered User
 
Join Date: Dec 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Adodc connections variable wont work, need help

Private Sub Command3_Click()
Dim file
file = Text1.Text

Adodc3.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= file "

Adodc3.RecordSource = "select * from stock"
Adodc3.Refresh
End Sub

help me!!!
  #2 (permalink)  
Old December 10th, 2006, 11:21 AM
Friend of Wrox
 
Join Date: May 2006
Location: San Diego, CA, USA.
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Okay. Is that your actual connection string?
For one thing, the Data Source has to point to an actual file rather than the word "file". In this case, you have named a variable "file", and I am assuming you want to use that variable, and also assuming that this variable will actually contain the path to the mdb file you wish to use, then a starting point will be to change the line to this:

Adodc3.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & file


Woody Z
http://www.learntoprogramnow.com


Similar Threads
Thread Thread Starter Forum Replies Last Post
ADODC PROBLEM cnkumar74 VB Components 0 February 16th, 2007 03:27 AM
adodc and flexgrid! smileii VB Databases Basics 6 October 18th, 2006 01:33 PM
code clinic - Why wont example asp code work? jardbf Classic ASP Basics 3 April 27th, 2006 06:22 PM
JetComp Wont Work .....HELP!! timmaher Access VBA 3 August 25th, 2005 01:38 AM
Query wont work unless I copy and past into new on Mitch Access 1 March 4th, 2005 02:22 AM





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