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
Solved

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

Posted on 2011-03-22
2
931 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

829 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