?
Solved

Error:  ADOTable -->  "Invalid Object Name"

Posted on 2004-11-04
12
Medium Priority
?
1,593 Views
Last Modified: 2012-08-13
Hey there !

I want to use access to an MS-SQL-Server via  ADOConnection -> ADOTable.  
- The connection string in ADOConnection works: "Connected = true"
- The connection to ADOTable seems to work, too:  In "Table name" I can see all the names and select one.
But:
- The attempt to switch "Active = true" in ADOTable results in an error: "Invalid object name <tablename>"

What's wrong ?

Thanks
KPB
0
Comment
Question by:KPBecker
12 Comments
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 12494608
Try to enclose the tabel name in square brackets, i.e. [myTable name]
0
 
LVL 17

Accepted Solution

by:
Wim ten Brink earned 900 total points
ID: 12494690
I think it's a security issue. You've created the table using user account X and in your application you're trying to access it using account Y. It could be related to this. The user account that you use to access the database might be allowed to see tablenames but might not be allowed to access it.
It's a suggestion I've picked up at http://www.sqljunkies.com/Forums/ShowPost.aspx?PostID=1851 after googling for it. :-)
0
 

Author Comment

by:KPBecker
ID: 12502697
Thank you, I keeps strange:

- square brackets have no effect.

- Using the "OLE DB Provider for SQL Server" ('Provider=SQLOLEDB.1' in the connection-string) does not work and results in the error described above.

- Using  the  "OLE DB Provider for ODBC drivers" ('Provider=MSDASQL.1' in the connection-string) _works_, but it takes about 20s (!) to switch "active" from 'false' to 'true'  in ADOTable.  The table can be shown correctly in a DBGrid, but this is not practicable. It takes the same time again to set a second table to 'active' in another ADOTable.

May this be a hint in regard to a security issue ?

Thanks
KPB
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 17

Assisted Solution

by:Wim ten Brink
Wim ten Brink earned 900 total points
ID: 12503966
SQL Server is supposed to be fast, even with Delphi. But the security can sometimes be a real pain because you might have the administrator who creates the table and a user who wants to access it. But the user might not have access rights...
But I would like to suggest to use a TADOQuery instead of a TADOTable. The Table class has some additional overhead that might be slowing down things. Keep the TADOQuery very simple by just using 'select * from YourTable' and activate it. It's even an interesting because an ADO query can be updated just like an ADO table. It's not read-only like the BDE query. You can actually modify data in the query and these modifications will be processed correctly. (Unless you do a select over more than a single table.)
Also keep in mind that if the table is huge, then it takes a while for SQL Server to retrieve all records when you activate it. This is a drawback of ADO, since it will retrieve all selected data to the client application.
0
 

Author Comment

by:KPBecker
ID: 12505443
I got an email telling me that Workshop_Alex sent another comment but I cannot see it here ?
Got it lost ?
KPB
0
 

Author Comment

by:KPBecker
ID: 12505456
Just now Alex's comment arrived !
KPB
0
 

Author Comment

by:KPBecker
ID: 12512506
There is no difference in regard to my probem wether I take TADOTable or TADOQuery:

- Using the "OLE DB Provider for SQL Server" ('Provider=SQLOLEDB.1' in the connection-string) does not work at all and results in the error described above ("Invalid Object name <tablename>") when I try to set TADOQuery to 'active'.

When I take the same username and the same password I can get access to the SQL-Server just by changing the driver. So I am not shure that it is a security-problem. But: ...

- Using  the  "OLE DB Provider for ODBC drivers" ('Provider=MSDASQL.1' in the connection-string) _works_, but it takes about 20s (!) to switch "active" from 'false' to 'true'  in TADOQuery or TADOTable.  The table can be shown correctly in a DBGrid, but this of course is not practicable. It takes the same time again to set a second table to 'active' in another TADOTable / TADOQuery.  Moreover, this seems to be independant from the size of the table.
During this time, my client pc is working very hard of its disk - I have no idea, what it is doing there.

Meanwhile I got the advice to re-install windows 2000 on the client because something with the configuration meight be confused !  I will try it on another pc first.

KPB

0
 

Author Comment

by:KPBecker
ID: 12512618
Addition:

The Delphi-exe with the SQL-driver does not work on another pc (NT 4.0) either.  Using the ODBC-driver here works but it is much faster and without working on the disk at such an extent.  Testing the connection (TADOConnection) always gives positive results.

Any more suggestions to solve my problem and get the SQL-driver to work ?
Thanks
KPB
0
 
LVL 6

Assisted Solution

by:Imthiyaz_ph
Imthiyaz_ph earned 600 total points
ID: 12592091
have u tried updating MDAC (Microsoft Data Access Components) ?
0
 

Author Comment

by:KPBecker
ID: 12601612
Yesterday I got the following email:

   Question Error:  ADOTable -->  "Invalid Object Name"
   Topic Delphi Programming

   Comment from Imthiyaz_ph
   Date 11/16/2004 02:05AM PST

Question:  Where is this comment ?   The same thing happend on 11/05/2004 !

KPB
0
 

Author Comment

by:KPBecker
ID: 12601617
Strange  -  now I can see  Imthiyaz_ph's comment.

It looks as if I have to send a comment by myself in order to be able to see the comments added by others.

KPB
0
 
LVL 1

Expert Comment

by:huynhcaoky
ID: 21219526
i have the same problem, i also tried with all users in SQL, but i still have error. Does anyone advice more?
Thanks
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

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…
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 Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

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