Solved

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

Posted on 2011-03-22
2
940 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
[X]
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 Comments
 
LVL 32

Accepted Solution

by:
Ephraim Wangoya 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

695 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