Showing posts with label connect. Show all posts
Showing posts with label connect. Show all posts

Friday, March 23, 2012

Invalid object name one_two_threefour_five_six11.

Hi,

I am trying to connect sql server 2005 with JDBC driver from a java program.(got from microsoft).It is simple class that retreving all the data of table.

i am doing "select * from one_two_threefour_five_six11 " . But it is giving
Exception of type 'com.microsoft.sqlserver.jdbc.SQLServerException Detail Message: Invalid object name 'one_two_threefour_five_six11'.

But the table is there in the database i given in configuration.This program is working for other tables. when i do the same query in Query analyzer it is showing data.

Please help me..

Thanks in advance.

venkateither something is wrong with your connection string or there is a ownership or permissions issue.|||Personally, I think sql server is making fun of you with a table_name like that

Check the owner|||Try this query instead:

select db_name()sql

Invalid Object Name ctsv_####...

DB Gurus,

I have a VB 6 utility that is using ADO to connect to replicated tables and I get the following error when I try to update the recordset:

Invalid Object Name 'ctsv_18C3929C22...'

This code worked great until the team that owns one of our SQL servers decided to turn of Replication. After getting replication back up and running, we set up a push subscription rather than a pull as before.

The util is running against the subscriber's tables...not the source tables.

What the heck have I gotten into here?

What does ctsv mean?

Thanks,
GregGood question, what the heck is it? Also make sure you fully qualify table names with schema owner. Maybe that's what it's barking at...

Invalid Object Name

I restored all Databases in other server.

First I restored the master database and after the others databases. But when I connect by Query Analyser with a user that is a DBO and I execute a select the system return : "Invalid object name 'XXXX'"

My MS-SQL is the version 7.0.What happens when you run this query on that database:

select uid, name
from sysobjects
where name = 'XXXX'

where 'XXXX' is the name of the table you are after.

Invalid Object Name

Ok I'm trying to connect to my easycgi.com MSSQL database.

I can connect OK.

My ID is in the db_owner group.

I can create and edit tables and data.I can open a table and see the data.I can view the SQL statement behind the open table (select * from Table) and execute it successfully.

But if I open a new query window and type "select * from [table]" (or any other query), no matter which table it is, I get an error:

Msg 208, Level 16, State 1, Line 1
Invalid object name '[table name]'.

I've searched the web and found this error plenty of times, usually associated with security or the schema. But all my objects are under dbo and I'm in db_owner... ?

Can you post the exact query you typed into the query analyzer?

|||

I'll go you one better:


|||

Try:

sp_help 'Messages'

or

SELECT*

FROMINFORMATION_SCHEMA.TABLES

and given what you've said, "SELECT USER" should return "dbo", correct?

|||

sp_help 'Messages' gives me this:

Msg 15009, Level 16, State 1, Procedure sp_help, Line 66
The object 'Messages' does not exist in database 'master' or is invalid for this operation.

SELECT *

FROM INFORMATION_SCHEMA.TABLES gives me:

master dbo spt_fallback_db BASE TABLE
master dbo spt_fallback_dev BASE TABLE
master dbo spt_fallback_usg BASE TABLE
master dbo spt_monitor BASE TABLE
master dbo spt_values BASE TABLE

SELECT user gives me "guest"... ? I'm logged on under my own ID.

|||

Ok I disconnected and reconnected, then went to options and told it to connect to my individual database and that seems to have done it... Never had to do that before but I guess querying interactively requires a direct connection to my DB. Strange.

Monday, March 12, 2012

Invalid Connection message

I have a database running under MSDE 2000 to which I can connect either
through MS Access or Coldfusion. However, I wanted to run a script at the
command prompt to try and have an automatic backup.
I typed OSQL -Usa -P at the command prompt and supplied a valid password but
after a few moments I got back:
[Shared Memory] Invalid connection.
[Shared Memory]ConnectionOpen (Invalid Instance()).
Can anyone point me in the right direction as to what might be wrong?
many thanks
june
hi June,
June Macleod wrote:
> I have a database running under MSDE 2000 to which I can connect
> either through MS Access or Coldfusion. However, I wanted to run a
> script at the command prompt to try and have an automatic backup.
> I typed OSQL -Usa -P at the command prompt and supplied a valid
> password but after a few moments I got back:
> [Shared Memory] Invalid connection.
> [Shared Memory]ConnectionOpen (Invalid Instance()).
>
did you provide the correct instance name in the form
osql -S(local)\InstanceName
?
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.15.0 - DbaMgr ver 0.60.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||Thank you, that was the problem. I will now attempt to run my script.
June
"Andrea Montanari" <andrea.sqlDMO@.virgilio.it> wrote in message
news:3p0ba1F82e2mU1@.individual.net...
> hi June,
> June Macleod wrote:
> did you provide the correct instance name in the form
> osql -S(local)\InstanceName
> ?
> --
> Andrea Montanari (Microsoft MVP - SQL Server)
> http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
> DbaMgr2k ver 0.15.0 - DbaMgr ver 0.60.0
> (my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
> interface)
> -- remove DMO to reply
>

Friday, March 9, 2012

'Invalid authorization specification' from IDBInitialize::Initialize (c++)

Hi

I've been trying to connect to my local SQL Server instance (SQL Server 2005) using the SQLNCLI interface from c++ without success. I consistently receive an 'Invalid authorization specification' error (SQL state 28000 and SQL error number 0) when I call IDBInitialize::Initialize to connect to the database. I was hoping someone here could shed some light on this and help me out.

The strange thing is that I get no error if I leave the user blank (L"" in vValue.bstrVal) and try to connect. Also, IDBProperties::SetProperties returns 0 when the user is blank but 40eda when the user is set. This seems to be a message from the pipeline facility but I haven't found the description of the code (0xeda).

The user in the database is configured with no password and I can successfully connect to the server and open the database using that user through Management Studio.

I've also tried using the SQLOLEDB provider with the same results.

Suspecting that I'm setting the properties wrong I include a code snippet below showing how I'm setting the properties:

for (int i = 0; i < sizeof(dbprop) / sizeof(dbprop[0]); i++)
VariantInit(&dbprop[ i ].vValue);

// Server name
dbprop[0].dwPropertyID = DBPROP_INIT_DATASOURCE;
dbprop[0].vValue.vt = VT_BSTR;
dbprop[0].vValue.bstrVal = SysAllocString(L"localhost");
dbprop[0].dwOptions = DBPROPOPTIONS_REQUIRED;
dbprop[0].colid = DB_NULLID;

// Database
dbprop[1].dwPropertyID = DBPROP_INIT_CATALOG;
dbprop[1].vValue.vt = VT_BSTR;
dbprop[1].vValue.bstrVal = SysAllocString(L"test");
dbprop[1].dwOptions = DBPROPOPTIONS_REQUIRED;
dbprop[1].colid = DB_NULLID;

// Username
dbprop[2].dwPropertyID = DBPROP_AUTH_INTEGRATED;
dbprop[2].vValue.vt = VT_BSTR;
dbprop[2].vValue.bstrVal = SysAllocString(L"jph");
dbprop[2].dwOptions = DBPROPOPTIONS_REQUIRED;
dbprop[2].colid = DB_NULLID;

Cheers,
JPProblem solved.

A little bit embarrasing, since I, somehow, misinterpreted the DBPROP_AUTH_INTEGRATED parameter. It should have been DBPROP_AUTH_USERID (of course) instead.

The username propertie now looks like this:

// Username
dbprop[2].dwPropertyID = DBPROP_AUTH_USERID;
dbprop[2].vValue.vt = VT_BSTR;
dbprop[2].vValue.bstrVal = SysAllocString(L"jph");
dbprop[2].dwOptions = DBPROPOPTIONS_REQUIRED;
dbprop[2].colid = DB_NULLID;

and works like a charm.

JP

Invalid authorization specification

Hi:

I'm trying to connect to a data base of "sql server 2005 enterprise" named BCR.
The server name is "server1"
I'm using Windows Authentication to connect to server
The operating system is Windows Server 2003 Enterprise Edition Service Pack 1

When I run the aspx I get this error at line 21

System.Data.OleDb.OleDbException: Invalid authorization specification Invalid connection string attribute at System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) at System.Data.OleDb.OleDbConnection.InitializeProvider() at System.Data.OleDb.OleDbConnection.Open() at ASP.pruebaLeeSqlServer_aspx.__Render__control1(HtmlTextWriter __output, Control parameterContainer) in Z:\Digital\pruebaLeeSqlServer.aspx:line 21

This is my code:

Dim str2 As String = "Provider=SQLNCLI; Server = server1; Database = BCR"
Dim cnn2 As OleDbConnection = New OleDbConnection(str2)
Dim cmd2 As New OleDbCommand()
Dim drd2 As OleDbDataReader
Try
cnn2.Open()
cmd2.Connection = cnn2''''line 21
cmd2.CommandText ="SELECT LastName FROM Employees"
drd2 = cmd2.ExecuteReader
Do While drd2.Read
%>
<%=drd2.GetString(0)%><br>
<%
Loop
drd2.Close()
Catch exc1 As Exception
%>
<%=exc1.ToString()%>
<%
Finally
cnn2.Close()
End Try

What could be wrong?
Do I need enable permission for asp.net in sql server?
how I can do it?

Thanks!!

You should be using the objects in the System.Data.SqlClient namespace to connect to MS SQL Server, not System.Data.OleDb. That should fix your issue given that there is no problem with your connection string.

HTH,
Ryan

|||thanks Ryan. It works!

I are right, I had to use System.Data.SqlClient namespace instead of System.Data.OleDb. And I just change my connection string to

"Server=server1; Database=BCR; Trusted_Connection=True;"

Thanks!

Wednesday, March 7, 2012

invalid attribute/option identifier

Hi
I currently have a problem with registering a new server in my Enterprise
Manager on a new PC.

I need to connect to a MSSQL2K server on a windows 2003.
My current PC is on the same LAN as the server and has no problem
registering the server in Enterprise manager. This PC uses NT (about time I
change :-)

The new PC runs WIN2K. But this PC is on another LAN and has to access the
server through a firewall. Port 1433 is open in the firewall.
I use a Firewall-1 authentication agent to access the server.

I use SQL authentification to logon (sa account), I have checked that the
new clients network libraries are the same version as the servers.
In the client network Utility I have set up an alias with the server I want
to access.

The registration seems to access the SQL server, but comes out with an error
stating: "invalid attribute/option identifier"

When I search KB with this message, I get nothing. Did anyone in here
experience anything like this? Any pointers to help me move on would be
greatly appreciated.

best regards
Ren Pedersen"Ren Pedersen" <rpe@.post6.tele.dk> wrote in message
news:4107a915$0$175$edfadb0f@.dtext01.news.tele.dk. ..
> Hi
> I currently have a problem with registering a new server in my Enterprise
> Manager on a new PC.
> I need to connect to a MSSQL2K server on a windows 2003.
> My current PC is on the same LAN as the server and has no problem
> registering the server in Enterprise manager. This PC uses NT (about time
I
> change :-)
> The new PC runs WIN2K. But this PC is on another LAN and has to access the
> server through a firewall. Port 1433 is open in the firewall.
> I use a Firewall-1 authentication agent to access the server.
> I use SQL authentification to logon (sa account), I have checked that the
> new clients network libraries are the same version as the servers.
> In the client network Utility I have set up an alias with the server I
want
> to access.
> The registration seems to access the SQL server, but comes out with an
error
> stating: "invalid attribute/option identifier"
> When I search KB with this message, I get nothing. Did anyone in here
> experience anything like this? Any pointers to help me move on would be
> greatly appreciated.
> best regards
> Ren Pedersen

There are a few hits on Google which suggest reinstalling MDAC and/or the
client tools, plus this post about a specific DLL:

http://groups.google.com/groups?hl=...ng.google .com

Simon|||Worked like a charm - thank you very much.

regards
Ren

"Simon Hayes" <sql@.hayes.ch> skrev i en meddelelse
news:4107ea67$1_2@.news.bluewin.ch...
> "Ren Pedersen" <rpe@.post6.tele.dk> wrote in message
> news:4107a915$0$175$edfadb0f@.dtext01.news.tele.dk. ..
> > Hi
> > I currently have a problem with registering a new server in my
Enterprise
> > Manager on a new PC.
> > I need to connect to a MSSQL2K server on a windows 2003.
> > My current PC is on the same LAN as the server and has no problem
> > registering the server in Enterprise manager. This PC uses NT (about
time
> I
> > change :-)
> > The new PC runs WIN2K. But this PC is on another LAN and has to access
the
> > server through a firewall. Port 1433 is open in the firewall.
> > I use a Firewall-1 authentication agent to access the server.
> > I use SQL authentification to logon (sa account), I have checked that
the
> > new clients network libraries are the same version as the servers.
> > In the client network Utility I have set up an alias with the server I
> want
> > to access.
> > The registration seems to access the SQL server, but comes out with an
> error
> > stating: "invalid attribute/option identifier"
> > When I search KB with this message, I get nothing. Did anyone in here
> > experience anything like this? Any pointers to help me move on would be
> > greatly appreciated.
> > best regards
> > Ren Pedersen
> There are a few hits on Google which suggest reinstalling MDAC and/or the
> client tools, plus this post about a specific DLL:
>
http://groups.google.com/groups?hl=...ng.google .com
> Simon

Friday, February 24, 2012

interupt JDBC SQL query connection

Hi

I using Java and JDBC to connect to MS SQL server 2000 (using the MS
drivers msbase,msutil and mssqlserver.jars).

Sometimes it takes a long time for statement.executeQuery
to return and start returning the resultset
(full DB scan can take 30-40 minutes).

Does anyone know if it's possible to interupt/halt the query before
it eventually comes back. The setQueryTimeout works OK but this has to be
set quite high to allow real queries to run correctly. What I'm trying
to do is allow users to halt their query if they've realised they
want to alter it or its taking too long. The query is running in a
separate thread and I've tried using the main thread to close the
connection or stop the query but this still waits until the resultset
is returned.

Maybe it's a driver issue or ....

Thanks
MikeHi

I am not sure about the JDBC driver itself, but you could use a timer thread
to kill it off.

John

"Mike Read" <mar@.roe.ac.uk> wrote in message
news:Pine.OSF.4.58.0406091501320.263861@.reaxp06.ro e.ac.uk...
> Hi
> I using Java and JDBC to connect to MS SQL server 2000 (using the MS
> drivers msbase,msutil and mssqlserver.jars).
> Sometimes it takes a long time for statement.executeQuery
> to return and start returning the resultset
> (full DB scan can take 30-40 minutes).
> Does anyone know if it's possible to interupt/halt the query before
> it eventually comes back. The setQueryTimeout works OK but this has to be
> set quite high to allow real queries to run correctly. What I'm trying
> to do is allow users to halt their query if they've realised they
> want to alter it or its taking too long. The query is running in a
> separate thread and I've tried using the main thread to close the
> connection or stop the query but this still waits until the resultset
> is returned.
> Maybe it's a driver issue or ....
> Thanks
> Mike|||how many people here get the luxery of creating and maintaining apps in
jbuilder and together everyday? care to share any stories, either great
or not so great! i just got an eval of the latest and greatest installed
and after using previous versions for years, what i see now looks really
great. just was wondering about your experiences.

cheers

- perry|||I'm just new in the Java World and also JBuilder X Enterprise IDE. I'm
making a servlet client , using Struts , because the MVC pattern is just what
we need for our application.
Until now this is working just fine. I like the IDE, autocompletion, colors,
indent, etc.
The progam gives a lots of tips and help using class, packages, etc.

Greetings....

In comp.lang.java perry <perry@.cplusplus.org> wrote:
: how many people here get the luxery of creating and maintaining apps in
: jbuilder and together everyday? care to share any stories, either great
: or not so great! i just got an eval of the latest and greatest installed
: and after using previous versions for years, what i see now looks really
: great. just was wondering about your experiences.

: cheers

: - perry

--
Alfredo Diaz
================
School of Engineering and Science, University of Chile
Beaucheff 850, P.O. Box 2777, Santiago, CHILE
mailto:aadiaz@.dcc.uchile.cl.nospam|||Mike Read (mar@.roe.ac.uk) writes:
> I using Java and JDBC to connect to MS SQL server 2000 (using the MS
> drivers msbase,msutil and mssqlserver.jars).
> Sometimes it takes a long time for statement.executeQuery
> to return and start returning the resultset
> (full DB scan can take 30-40 minutes).
> Does anyone know if it's possible to interupt/halt the query before
> it eventually comes back. The setQueryTimeout works OK but this has to be
> set quite high to allow real queries to run correctly. What I'm trying
> to do is allow users to halt their query if they've realised they
> want to alter it or its taking too long. The query is running in a
> separate thread and I've tried using the main thread to close the
> connection or stop the query but this still waits until the resultset
> is returned.

You will have to examine the documetation for the JDBC driver. Most
client APIs for SQL Server supplies functions for asynchronous calls.
With a asynch call, you could then issue a cancel request (again this
is offered by most client APIs).

microsoft.public.sqlserver.jdbcdriver may offer more exact answers with
regards to that driver.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp