Error: ADOTable --> "Invalid Object Name"

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
KPBeckerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DragonSlayerCommented:
Try to enclose the tabel name in square brackets, i.e. [myTable name]
0
Wim ten BrinkSelf-employed developerCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
KPBeckerAuthor Commented:
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
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

Wim ten BrinkSelf-employed developerCommented:
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
KPBeckerAuthor Commented:
I got an email telling me that Workshop_Alex sent another comment but I cannot see it here ?
Got it lost ?
KPB
0
KPBeckerAuthor Commented:
Just now Alex's comment arrived !
KPB
0
KPBeckerAuthor Commented:
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
KPBeckerAuthor Commented:
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
Imthiyaz_phCommented:
have u tried updating MDAC (Microsoft Data Access Components) ?
0
KPBeckerAuthor Commented:
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
KPBeckerAuthor Commented:
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
huynhcaokyCommented:
i have the same problem, i also tried with all users in SQL, but i still have error. Does anyone advice more?
Thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.