Solved

Can't get TAdsConnection to accept run-time data location assignment

Posted on 2011-03-22
2
926 Views
Last Modified: 2012-06-27
I am using Delphi XE with Advantage local server (9.1) on Windows 7.  I do not know the data table location until run-time and so have code that assigns the ConnectPath and IsConnected properties during the creation of the data module.  However, I keep getting the following error message:

Exception EADSDatabaseError in module DD3CRMOut.exe at 0048AAB4.  acctTbl: One of the DatabaseName property or the AdsConnection property must have a value.

acctTbl is the first table in the data module.  The table has a value in the AdsConnection property (Which is the name of the AdsConnection) and the Active property is set to false.

The AdsConnection ConnectPath property is null and the IsConnected property is set to false.

If I enter a location that has a table in the ConnectPath property of AdsConnection, the error messages go away (even though the IsConnected property is still false).

I need to be able to provide the data location only at run-time.  How do I do this?
0
Comment
Question by:sysjames
2 Comments
 
LVL 32

Accepted Solution

by:
ewangoya earned 500 total points
ID: 35195266

There could be somewhere else in your code that is trying to make a connection when the form or datamodule is being created.
Check your FormCreate/DataModuleCreate methods or any other form that uses this connection if they are trying to set the Connected property to true.
Or possibly one of the tables has its active property set to true before the AdsConnection's path has been set to a valid path at runtime

Now if you are going to get the correct path at runtime, there is no harm in leaving  a dummy ConnectPath on the connection since you will ovewrite it at runtime but its better to find out what is calling the connection and causing the error
0
 

Author Comment

by:sysjames
ID: 35202747
All of your advice is good amd I've checked all those things.  I am now going to create a known data area on the disk and use it (hard coded) because I'm running out of time for this release).

Example.  I made a routine for the BeforeOpen event of the table in question.  I set a breakpoint there and the error occured before the breakpoint was encountered.  Which I don't understand how that could be.

Thanks again.
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

772 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