Solved

ADODC.connectionstring empty at form_load...

Posted on 1999-01-07
4
180 Views
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?
0
Comment
Question by:juul040798
  • 2
4 Comments
 
LVL 2

Expert Comment

by:mkmccreary
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,
Martin
0
 
LVL 4

Accepted Solution

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

e.g

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

0
 

Author Comment

by:juul040798
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...
0
 
LVL 4

Expert Comment

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

0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBA saving file message display 5 67
MS Acccess - Update Field in Table when report is printed 6 45
Excel - Save a copy of work book 13 85
Passing a Text Box name to a Sub 6 96
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

809 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