Discussion:
Strange Behavior with dbexpress
(too old to reply)
John Jacobs
2007-10-29 19:32:36 UTC
Permalink
We are working on migrating our application form BDE (paradox) to dbexpress
and sql server 2005 sp2. We're getting some interesting error messages when
running queries that look at the master database. We are using "Borland®
Developer Studio for Microsoft® WindowsT Version 10.0.2288.42451 Update 2".
One of the queries I'm having problems with looks like this:
select loginame=rtrim(loginame), hostname,
dbname = case
when dbid = 0 then null
when dbid <> 0 then db_name(dbid)
end
,Login_Time,nt_userName
from master.dbo.sysprocesses

where db_Name(dbid) = 'LubeData' and dbId <> 0

I'm creating the TSQLQuery component on the fly and associating it to the
SQLConnection. Then when I open it I get the following error:
Project xxx raised exception class EDatabaseError with message 'Database
Server Error: SQL State: HY000, SQL Error Code: 0
Protocal error in TDS stream.

I've plugged the the above query into sql server management studio and it
works, and It also working in Data Explorer. Also if I drop a TSQLQuery
Component onto a datamodule and fill in the above query I can Set the state
to active without error at design time. But when I try to set it to active
at run time I get the error.

Any Ideas?

Thanks
Preston
2007-10-31 16:10:17 UTC
Permalink
If you run the profiler do you see the query getting to SQL Server?
John Jacobs
2007-11-05 20:29:56 UTC
Permalink
Sorry for the delay. Was out of the office.

Yes, I am seeing the query getting to the SQL Server. I can see the
SQL:BatchStarting and SQL:BatchCompleted entries. But I'm still getting the
error message.

Thank
Post by Preston
If you run the profiler do you see the query getting to SQL Server?
Dan Downs
2007-11-06 17:31:11 UTC
Permalink
Post by John Jacobs
and sql server 2005 sp2. We're getting some interesting error messages
when running queries that look at the master database. We are using
"Borland®
If its only against the master database could it be a security/permission
issue?

DD
John Jacobs
2007-11-06 20:11:00 UTC
Permalink
Is there a quick way to verify if its security related?

John
Post by Dan Downs
Post by John Jacobs
and sql server 2005 sp2. We're getting some interesting error messages
when running queries that look at the master database. We are using
"Borland®
If its only against the master database could it be a security/permission
issue?
DD
Dan Downs
2007-11-06 21:38:19 UTC
Permalink
Post by John Jacobs
Is there a quick way to verify if its security related?
Unfortunitly I only have sql server 2000, and I'm not all that familuar with
all the security settings. you should be able to do a once over through
enterprise manager, or whatever they call it now, under the security group
or management group.

When you're creating queries at run time are you using sql authentication or
windows authentication? If its sql auth, then that user might not have
access to the master db.

DD
John Jacobs
2007-11-07 21:36:38 UTC
Permalink
Thanks,

I'll do some checking. I'm using windows authentication.
Post by Dan Downs
Post by John Jacobs
Is there a quick way to verify if its security related?
Unfortunitly I only have sql server 2000, and I'm not all that familuar
with all the security settings. you should be able to do a once over
through enterprise manager, or whatever they call it now, under the
security group or management group.
When you're creating queries at run time are you using sql authentication
or windows authentication? If its sql auth, then that user might not have
access to the master db.
DD
Dan Downs
2007-12-03 22:03:00 UTC
Permalink
Did you ever figure this out?

DD

Loading...