Showing posts with label machine. Show all posts
Showing posts with label machine. Show all posts

Friday, March 30, 2012

Mars Connection Problem

I am trying to make a connection to an SQL database held on myserver I am able to connect through a machine data source using access using the credentials as below the attempt fails at con.open with following error:

System.Runtime.InteropServices.COMException was caught
ErrorCode=-2147467259
Message="Named Pipes Provider: Could not open a connection to SQL Server [53]. "
Source="Microsoft SQL Native Client"
StackTrace:
at ADODB.ConnectionClass.Open(String ConnectionString, String UserID, String Password, Int32 Options)
at Client_Access.JobRequest.AddJob_Click(Object sender, EventArgs e) in C:\Documents and Settings\Robert\My Documents\Visual Studio 2005\Projects\ Client Access\ Client Access\JobRequest.vb:line 392

Dim con As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim sPassword As String, sUserID As String
sPassword = "abcde"
sUserID = "cClient"
Try
con.ConnectionString = "Provider=SQLNCLI;" _
& "Server=(myserver);" _
& "Database=transportRecs;" _
& "Integrated Security=SSPI;" _
& "DataTypeCompatibility=80;" _
& "UID=" & sUserID & ";" _
& "PWD=" & sPassword & ";" _
& "MARS Connection=True;"
Dim mySQL As String

mySQL = "SELECT * FROM dbo_jobitem " '& _
'" WHERE [Custid] ='" & strTag & "'"

con.Open()

rst = New ADODB.Recordset
With rst
.ActiveConnection = con
.CursorLocation = ADODB.CursorLocationEnum.adUseClient
.CursorType = ADODB.CursorTypeEnum.adOpenStatic
.LockType = ADODB.LockTypeEnum.adLockBatchOptimistic
.Open(mySQL)
.MoveLast()
.MoveFirst()
.MoveLast()
.MoveFirst()
Debug.Print(.RecordCount)
End With

Catch ex As Exception
MsgBox(ex.ToString)
Finally
If (con.State = ConnectionState.Open) Then con.Close()
End Try

Can anyone help.

Regards,
Joe

The connection string is pooched. Use a UDL to write the connection string for you.

1. Open notepad

2. Save the blank file as test.udl to your desktop

3. Open the UDL and create and test your connection string.

4. Close and open in notepad

5. Copy the generated connection string

Adamus

|||

Hi Adamus Turner

I have follwed the instructions supplied. The connection is good using the connection string below:

con.ConnectionString = "Provider=MSDASQL.1;Password=abcde;Persist Security Info=True;User ID=cClient;Mode=ReadWrite;Extended Properties= DSN=TransportDB_Comp1;Description= ;UID= cClient;PWD=abcde;APP=Microsoft? Windows? Operating System;WSID=MIDLAPTOP2; transportRecs;Network=DBMSSOCN" & _

"MARS Connection=True;"

Dim mySQL As String

mySQL = "SELECT dwjobitemid FROM dbo_jobitem"

'";" '" WHERE [Custid] ='" & strTag & "'"

con.Open()

rst = New ADODB.Recordset

With rst

.ActiveConnection = con

.CursorLocation = ADODB.CursorLocationEnum.adUseClient

.CursorType = ADODB.CursorTypeEnum.adOpenStatic

.LockType = ADODB.LockTypeEnum.adLockBatchOptimistic

.Open(mySQL)

.MoveLast()

.MoveFirst()

.MoveLast()

.MoveFirst()

MsgBox(.RecordCount)

End With

When the connection attemps to open a record set (.open(mySQL) an error is called, Invalid object name? I know the table exists?

Regards

Joe

|||

Is the table name dbo_jobitem or dbo.jobitem?

It's a strange convention to use an underscore.

Adamus

|||

Also, do not post logins and passwords to databases.

Moderator, please remove login and password from connection string.

Adamus

|||

Hi Adamus

I have managed to sort out the problem, the issue was not with the connection string after I had used your advice the connection was good. The database tables when viewed on the sql server all had names starting “dbo_” I had attempted to look at the database schema.tables using “select * from information_schema.tables” out of vbnet but could not work out how you returned recordset!table_name in vb.net> I did managed to achieve this using vba. The table names returned were all shown minus the “dbo_” prefix I altered my sql to match and bingo.

Any user names, passwords etc used in my examples are all fictitious. And have been used for illustration only. Many thanks for your assistance with my postings

Regards

Joe

Monday, March 19, 2012

manual way to rename instance of analysis server?

is there a way to manually rename my instance of analysis server 2005? i have a 32bit machine, and the 32bit version of sql server 2005 and analysis server 2005 installed, yet i continually get an error. this happens on my servers too, which are all 32 bit. does anyone know of a manual work around ( via regestry maby) to rename an instance?

You should not need to rename an instance.

Can you tell us what error you are getting? There may be another solution to your problem.

|||Yes, there is a way to rename the instance. Search for ASInstanceRename.exe program under %Program Files%\Microsoft SQL Server. But, as Darren has suggested, you might want to not do it right away because it might not fix your problem and make things even worse since it is unknown what is causing your current problem. The utility operates on registry, service control manager, some setup related stuff, performance counters, redirector etc.

Friday, March 9, 2012

Managing subscribers from remote machine?

It looks like I can manage mostly everything within NS schema remotely, except subscribers and subscriptions.

The SubscriberEnumeration class wants an NSInstance reference, which only works running on local SQL server. As it reads and writes directly to the registry.

Is there something that I’m over looking to be able to enumerate the subscribers for an instance from a remote machine?

John

Install the client tools and then register the SSNS instance on the remote machine. That'll give you the API and registry entries you'll need.

HTH...

Joe|||

I have looked through the enumeration class. It only works on the local SQL server; I cannot use the class on my client machine and manage the subscriptions remotely with it. I have although, found that for every Instance's database, there are stored procedures that i can call to get a list of subscribers and devices and so fourth.

John

|||The SSNS API can be used from a remote machine. In fact, this is the most common deployment scenario - SSNS running on one server, the backend database running on a separate server, and the Subscription Management Application running on a web server.

To gain access to the remote instance of SSNS you'll need to install the client components and register the instance (pointing it to the remote server that hosts the instance, this will create the necessary registry entries, performance counters for you).

Here are a few links that may help.

http://msdn2.microsoft.com/en-us/library/ms171319.aspx
http://msdn2.microsoft.com/en-us/library/ms171263.aspx
http://msdn2.microsoft.com/en-us/library/ms143466.aspx
http://msdn2.microsoft.com/en-us/library/ms172627.aspx

HTH...

Joe

Wednesday, March 7, 2012

Managing MSDE and SQL Express...

Hi all,
I'm a newbie so I won't mind if you roll your eyes as you read this...
I have sqlExpress installed on my machine and its working beautifully.
I have used SqlExpress and msde in the past for web development with
great success, but I have always had an issue managing the databases in
Visual Studio.net or VisualWebDev2k5 in as much as its cumbersome and
hard to manage not to mention slower.
Is there any sort of stand-alone interface - like SQL enterprise
manager -- to help with this?
Thanks (in advance) for the help.
hi,
tom.herz@.gmail.com wrote:
> Hi all,
> I'm a newbie so I won't mind if you roll your eyes as you read
> this...
>
> I have sqlExpress installed on my machine and its working beautifully.
> I have used SqlExpress and msde in the past for web development with
> great success, but I have always had an issue managing the databases
> in Visual Studio.net or VisualWebDev2k5 in as much as its cumbersome
> and hard to manage not to mention slower.
> Is there any sort of stand-alone interface - like SQL enterprise
> manager -- to help with this?
> Thanks (in advance) for the help.
please have a look at SQL Server Management Studio Express, currently
available as CTP from
http://www.microsoft.com/downloads/d...displaylang=en
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.16.0 - DbaMgr ver 0.61.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||all,
> I'm a newbie so I won't mind if you roll your eyes as you read this...
>
> I have sqlExpress installed on my machine and its working beautifully.
> I have used SqlExpress and msde in the past for web development with
> great success, but I have always had an issue managing the databases in
> Visual Studio.net or VisualWebDev2k5 in as much as its cumbersome and
> hard to manage not to mention slower.
> Is there any sort of stand-alone interface - like SQL enterprise
> manager -- to help with this?
Check out Database Workbench at www.upscene.com
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
Server
Upscene Productions
http://www.upscene.com
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
|||Thanks. I've looked at both the options and this is what I needed. I
appreciate your time.
Have a great day - you all have certainly done your good deed!!