[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now


ADODC.connectionstring empty at form_load...

Posted on 1999-01-07
Medium Priority
Last Modified: 2013-12-25
I want to specify my ADODC.Connectionstring during the form_load of a program and keep this property empty as initial value. But I get an error at startup (before the form_load is completed) that the string is missing. With a normal Data-control the data1.databasename can be specified in the form_load. Why not with ADODC?
Question by:juul040798
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Expert Comment

ID: 1498818
Is the error you get:
    Data Source name not found, and no default driver specified.

or something like that.  If so try this.  Clear both the ConnectionString and the RecordSource property of the ADODC.  Then set the ConnectionString first, and the RecordSource next, during your Form_Load.  If this isn't your error, give me a little more information and I will try to figure it out for you.

Good Luck,

Accepted Solution

agarwal_rahul earned 400 total points
ID: 1498819
As Martin said clear both Connectionstring and Recordsource property and set at run time.


    Adodc1.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Northwind;Data Source=SG73300233"
    Adodc1.RecordSource = "SELECT * FROM ORDERS"
end sub


Author Comment

ID: 1498820
Is it possible that the adodc1.refresh is crucial in this subject. When I do this without the refresh, it seems not to work...

Expert Comment

ID: 1498821
Without Refresh u will not be able to populate the recordset.


Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question