Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combos Don't Display DB data

Status
Not open for further replies.

BillKilgore

Programmer
Mar 17, 2002
60
US
I've got a knotty problem here that I've been trying to resolve for some time.
In the application I've been working with, the . Specifically, my problem here is that functions that performed fine on the computer I wrote them on at home don't work on the IBM ThinkPad I'm working with out in the
field. Everything compiles OK but the combo boxes I'm using to display a list of log specie names for user selection no longer extract/display the data from my Access (2000) database.

The operating systems, database, and Delphi 7.0 are all the same as on my home system.
The database is in a different directory but I've revised the environmental variables to reflect the new paths and changed the various Connection Strings associated with the Datasources, ADOTables, and ADOQuerys as follow;

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Delphi Development\SawMill Operation Systems Development\SawMill_Operation.mdb;Persist Security Info=False

"Active" in both the ADOTables and ADOQuerys are set to false. Attempting to set their values to "True" results in an error for circular datalinks in the case of ADOTables or Missing SQL Property in the case of ADOQuerys. The following are the specifics from the form for the aforementioned objects.

object adotLogSpecie: TADOTable
ConnectionString =
'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Delphi Developme' +
'nt\SawMill Operation Systems Development\SawMill_Operation.mdb;P' +
'ersist Security Info=False'
CursorType = ctStatic
TableName = 'Specie'
Left = 208
end

object dsLogSpecie: TDataSource
DataSet = adotLogSpecie
Left = 168
end

object adoqLogSpecie: TADOQuery
ConnectionString =
'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Delphi Developme' +
'nt\SawMill Operation Systems Development\SawMill_Operation.mdb;P' +
'ersist Security Info=False'
DataSource = dsLogSpecie
Parameters = <>
Left = 248
end

This is only one of several lookup combos and only one database out of two I'm working on. None of the combos function as they did at home. I'm starting to wonder about some permission I've overlooked.
I could use some help here. And thank you for any you can provide.

B. Kilgore
 
well, those errors seem to be correct. You should probably fix those. You need to change your ADOQuery so that it does not point to the TDataSource. To display data in a form from to different data providers (TADOTable, TADOQuery) you will need two datasources.

Generally, you would use a single TADOConnection object, then link all of your TADOTable and TADOQuery objects to it, and then so on.

I don't know why the set up you have would work on any computer - so try those changes and see how it goes.
 
Thank you Griffyn. Adding the second DataSource allowed me to reset the Active to true. I must have deleted that particular one while I was monkeying around with it. Resetting all the other Tables to Active solved the problem. I am, however, at a loss to explain why all the Actives went to False when I transfered them from my home computer.

Anyway, thanks again, Bill K
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top