Monday, March 19, 2012
Connecting to MS Access File
file is not located on the same machine that many of the SQL servers reside.
Everything works great on the local machine using the ODBC Drivers Provider
as a one of the rds. The DSN file on the local development machine points to
the proper MS Access file. When the report is deployed to the reporting
server (not the local dev. box) a credentials error is encountered. Yes, I
have a DSN file on both different machines with the same name. Any help
would be much appreciated.Hello Corey,
I would not use a DSN; try a DSN-less connection string.
I think you can find one here: http://www.connectionstrings.com/
Francisco.
> I need help setting up a Read connection to a MS Access table. The
> Access file is not located on the same machine that many of the SQL
> servers reside.
> Everything works great on the local machine using the ODBC Drivers
> Provider as a one of the rds. The DSN file on the local development
> machine points to the proper MS Access file. When the report is
> deployed to the reporting server (not the local dev. box) a
> credentials error is encountered. Yes, I have a DSN file on both
> different machines with the same name. Any help would be much
> appreciated.
>
Sunday, March 11, 2012
Connecting to another SQL Server Instance
it from the other server. I set up the code listed below and got the error,
Line 1: Incorrect syntax near '\'. I tried removing the '\' and then it
indicated, Could not find server 'UMDPSMB7VSQLSERVERALT' in sysservers. Is
it possible to do this ?
Code: Select * From UMDPSMB7V\SQLSERVERALT.dbo.Rmtest.Table1This is a multi-part message in MIME format.
--=_NextPart_000_06FD_01C69CE1.737BB6A0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: quoted-printable
For Server 'instance' names, becasue of the backslash '\', you need to =put the server\instance name in square brackets. For example:
Select Column1
, Column2
, etc. From [UMDPSMB7V\SQLSERVERALT].dbo.Rmtest.Table1
Note: It's bad form to use SELECT *. Much better to list the columns you =want. If future needs cause any changes in the database, you code is =less likely to 'break'.
-- Arnie Rowland, YACE* "To be successful, your heart must accompany your knowledge."
*Yet Another Certification Exam
"rmcompute" <rmcompute@.discussions.microsoft.com> wrote in message =news:B79703B6-DABD-4D7F-92E7-E7E056D66CA3@.microsoft.com...
>I created another instance of SQL Server and am trying to access a =table on > it from the other server. I set up the code listed below and got the =error, > Line 1: Incorrect syntax near '\'. I tried removing the '\' and then =it > indicated, Could not find server 'UMDPSMB7VSQLSERVERALT' in =sysservers. Is > it possible to do this ?
> > Code: Select * From UMDPSMB7V\SQLSERVERALT.dbo.Rmtest.Table1
>
--=_NextPart_000_06FD_01C69CE1.737BB6A0
Content-Type: text/html;
charset="Utf-8"
Content-Transfer-Encoding: quoted-printable
=EF=BB=BF<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&
For Server 'instance' names, becasue of =the backslash '\', you need to put the server\instance name in square =brackets. For example:
Select
Column1
, =Column2
, etc. =From [UMDPSMB7V\SQLSERVERALT].dbo.Rmtest.Table1
Note: It's bad form to use SELECT *. =Much better to list the columns you want. If future needs cause any changes in the =database, you code is less likely to 'break'.
-- Arnie Rowland, YACE* "To =be successful, your heart must accompany your knowledge."
*Yet Another Certification =Exam
"rmcompute"
--=_NextPart_000_06FD_01C69CE1.737BB6A0--|||It worked. Thank you.
"Arnie Rowland" wrote:
> For Server 'instance' names, becasue of the backslash '\', you need to put the server\instance name in square brackets. For example:
> Select
> Column1
> , Column2
> , etc.
> From [UMDPSMB7V\SQLSERVERALT].dbo.Rmtest.Table1
> Note: It's bad form to use SELECT *. Much better to list the columns you want. If future needs cause any changes in the database, you code is less likely to 'break'.
>
> --
> Arnie Rowland, YACE*
> "To be successful, your heart must accompany your knowledge."
> *Yet Another Certification Exam
>
> "rmcompute" <rmcompute@.discussions.microsoft.com> wrote in message news:B79703B6-DABD-4D7F-92E7-E7E056D66CA3@.microsoft.com...
> >I created another instance of SQL Server and am trying to access a table on
> > it from the other server. I set up the code listed below and got the error,
> > Line 1: Incorrect syntax near '\'. I tried removing the '\' and then it
> > indicated, Could not find server 'UMDPSMB7VSQLSERVERALT' in sysservers. Is
> > it possible to do this ?
> >
> > Code: Select * From UMDPSMB7V\SQLSERVERALT.dbo.Rmtest
Thursday, March 8, 2012
Connecting to another server
Hi,
I have an adp that hits a databse on an 2005SQL server (databseserver). This server needs to pull information from another table in a SQL2000 server database (DBServer). When I click on the button on a form in the adp, I get this error:
"OLE DB provider "SQLNCLI" linked server communications error"
Now the server shows up in the SQL2005 Management studio, and I can open the tables in this database on this server from the studio. Additionally, it did work until recently as we changed the sa password.
I also was able to move some databases off of the SQL2000 server and then this database failed to move; it errors out.
I do not know what I am doing and am looking for help from anyone who can help.
the error looks like the linked server between sql 2005 and 2000 is not able to communicate... just check the Linkedserver configuration and makesure it is configured properly. post thecomplete error with error no
Madhu
|||Madhu please forgive me but I am not proficient in SQL server. I do not know how to check what you suggested. Could you give me some direction. The error message box that comes up in the ADP application say the following:
OLE DB Provider "SQLNCLI" for linked server "DBServer" returned message "Communication link failure"
Could you please specify what seerver I am to do it on also?
Thank you for your help!
|||click on Server Objects, right click on Linked Servers and create one if you dot' have one; or right click on the one select property to edit it.
hope this can help!
|||Ok! That did in fact help. I deleted the old link and created a new one but I still get the error I mentioned in my previous post about the communication link failure.|||OK... delete the existing linked server configuration and start afresh
Scenario
Servers : Server1 ,Server2
you want to configure Server2 as Linkedserver in SERVER1
All the below statement are to be run on Server1
(a) EXEC master.dbo.sp_addlinkedserver @.server = N'Server2', @.srvproduct=N'SQL Server'
(b) EXEC master.dbo.sp_addlinkedsrvlogin @.rmtsrvname=N'Server2',@.useself=N'False',@.locallogin=NULL,@.rmtuser=N'SomeLoginInServer2',@.rmtpassword='Password'
read more about Linked server in BOL
Madhu
|||Well this kind of worked! I can get into the server now. Problem is, that one of the tables doesn't seem to want to show up. I removed it from the ADP and now I can't get it back. All of the other linked tables show up however. Any ideas on this?|||
check the permission on this table... remotelogin should have permission on this table....
Madhu
|||I just recreated the view and it appears to be working! Thanks for the help, I really do appreciate it!connecting to a table
Hi
Please let me how to put a specific query to a database in the task and get the values from the db.
I have this code:
ConnectionManager cm = Microsoft.SqlServer.Dts.Runtime.DtsConvert.ToConnectionManager(
ComponentMetaData.RuntimeConnectionCollection["conRun"].ConnectionManager);
cm.Name = "TestConn";
cm.ConnectionString = "Data Source=srcServerName;Initial Catalog=srcDBName;" +
"Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;" +
"Auto Translate=False;";
After doing this, if i need to write a specific query to a table. How to do it.
Thanks
Vipul
Hi Vipul:
Not sure if this is exactly what you're trying to do, but I think this might be close to what you need.
I'm using the following code to extract a stored flat file date/time stamp from a SQL Server table.
Notice that I'm using a DataAdapter to populate a DataTable with the rows returned by the in-line
SQL statement. This function returns just the first column of the first row of the DataTable, but could
just as easily return the entire DataTable, or just one row from the table:
Private Function GetPreviousDateTimeStamp(ByVal pstrFileName As String) As Date
Dim cn As Data.SqlClient.SqlConnection
Dim cm As Data.SqlClient.SqlCommand
Dim da As Data.SqlClient.SqlDataAdapter
Dim dt As DataTable
Dim strSQL As String
Try
cn = New SqlConnection
'Set up a Connection object:
cn = CType(Dts.Connections("My_Connection_ADO" _
).AcquireConnection(Nothing), Data.SqlClient.SqlConnection)
strSQL = "SELECT PreviousDateTimeStamp " _
& "FROM dbo._FileTimeStamps " _
& "WHERE ImportFileName = '" & pstrFileName & "'"
'Establish a Command object with this SQL statement:
cm = New Data.SqlClient.SqlCommand(strSQL)
'Set Command object's Connection property:
cm.Connection = cn
'Set up a SqlDataAdapter:
da = New SqlDataAdapter(cm)
'Instantiate a DataTable:
dt = New DataTable
'Populate the DataTable:
da.Fill(dt)
'Return the first cell of the first row:
Return CType(dt.Rows(0).Item(0), Date)
Catch ex As Exception
Throw ex
End Try
End Function
Hope this helps! BTW: I could only get this code to work with an ADO connection,
and could not get it to work with an OLEDB connection. I'm sure someone here knows
why I couldn't use OLEDB, but it's working for me and I'm okay with that.
- Mike
|||Hi Mike:
Thanks for the reply. I was able to do it. This is my piece of code and i have made use of oledb only.
ConnectionManager cm = Microsoft.SqlServer.Dts.Runtime.DtsConvert.ToConnectionManager(
ComponentMetaData.RuntimeConnectionCollection["Source"].ConnectionManager);
ConnectionManagerOleDb cmoledb = cm.InnerObject as ConnectionManagerOleDb;
OleDbCommand oledbCommand;
String connMgrString = cm.ConnectionString;
OleDbConnection conn = new OleDbConnection(connMgrString);
conn.Open();
String query = "INSERT INTO Tab1 (First, Second) " + " VALUES ('TEST', 'TEST')";
oledbCommand = new OleDbCommand(query, conn);
oledbCommand.ExecuteNonQuery();
conn.Close();
You can check it if this helps.
Thanks
Vipul
|||Hi Vipul:
Is your code working now? It looks okay to me.
- Mike
|||Yes it works..
Thanks
Vipul
Wednesday, March 7, 2012
Connecting to a Full text catalog
How do I do that? I tried using the same format as connecting to a table but it did not work.
Full Text is an add on to SQL Server dependent on Microsoft Search Service, do you have it installed and the Microsoft Search Catalog must be populated to get search results. Try this link for a two part walk through. Hope this helps.
http://www.databasejournal.com/features/mssql/article.php/3441981
connecting to a database
if you can solve it that is ok if not !! get back to me and tell me what error message you got !
Saturday, February 25, 2012
Connecting tables from a different database to an application
which must refer to a table in a SQLServer 2000 database other than the main
database. When I connect, I get the data but the recordset is not updatable.
I can create a view in the main SQLServer database that makes the connection
and can be updated, but when I open that view in Access, it's still not
updatable.
Is there some simple way to update the data?
Hi,
http://support.microsoft.com/kb/328828
HTH, Jens K. Suessmeyer.
http://www.sqlserver2005.de
"TLD" <TLD@.discussions.microsoft.com> wrote in message
news:D6D862E7-D3AB-48EA-92D2-2479620DC822@.microsoft.com...
>I have an application using an Access 2003 project connecting through ADO
> which must refer to a table in a SQLServer 2000 database other than the
> main
> database. When I connect, I get the data but the recordset is not
> updatable.
> I can create a view in the main SQLServer database that makes the
> connection
> and can be updated, but when I open that view in Access, it's still not
> updatable.
> Is there some simple way to update the data?
>
|||Thanks for your help, but I don't see the answer to my problem in the article
referenced.
"Jens K. Suessmeyer" wrote:
> Hi,
> http://support.microsoft.com/kb/328828
>
> HTH, Jens K. Suessmeyer.
> --
> http://www.sqlserver2005.de
> --
> "TLD" <TLD@.discussions.microsoft.com> wrote in message
> news:D6D862E7-D3AB-48EA-92D2-2479620DC822@.microsoft.com...
>
|||The problem turned out to be that the "uneditiable" fields were char rather
than varchar. When the user put a cursor into the field, he wasn't able to
insert letters. Changing the configuration of the underlying table has
resolved the problem.
Thanks for your help.
"Jens K. Suessmeyer" wrote:
> Hi,
> http://support.microsoft.com/kb/328828
>
> HTH, Jens K. Suessmeyer.
> --
> http://www.sqlserver2005.de
> --
> "TLD" <TLD@.discussions.microsoft.com> wrote in message
> news:D6D862E7-D3AB-48EA-92D2-2479620DC822@.microsoft.com...
>
Friday, February 17, 2012
connecting analysis services to excel (client side)
Hi,
How is the configuration of connection for a client Excel pivot table connected to Analysis Services? Is there anyway in which when we copy the .xls with pivot table to client PC, it will automatically connect to Analysis Services?
thanks in advance.
cherrie
Cherrie,
Do you have analysis services database installed on each pc and want to connect allways locally? If so, then in connection string instead of specifying machine name, use localhost.
If this is not what you ask, could you please clarify your question. What do you mean automatically connect to Analysis Services?
Vidas Matelis
|||Hi,
Let's say I have a server in which Analysis Services is located together with my SQL Server database. Since currently, SSAS resides in my local drive from which the local excel is also connected through setting it up in Data > Import External Data > New Database Query > OLAP Cubes and it's doing well. But I'm thinking if let's say I want users to access the SSAS cube from the server to their local Excel? How would I configure the connection?
Thanks!
cherrie
|||Cherrie,
It looks like you are using Excel 2003. Steps for your users will be exactly the same. You go :
Data > Import External Data > New Database Query > OLAP Cubes > <New Data Source> > etc
Then you specify data source name, provider, click connect and specify "Analysis Server" name. This name could be name of your machine or SSAS Server.
Leave UserID & Password empty, then select database and you are done.
Vidas Matelis
|||Vidas,
Can the connection be stored in the UDL instead or store the connection somewhere in the local drive of the user apart from the .xls file?
Cherrie
Connecting a webpage to SQL
I have a table ClientInfo in SQL 2k. I want the customer
service dept to be able to add new clients and search for
ones to edit. I want other groups to be able to only view
client info read-only.
1. I assume creating a webpage is probably better than
an .adp file?
2. If I do a webpage, how do I deal with the
permissions? Should I create a login table and add all
the users/pwd in there and set the level of security that
way? Or is there a way to base it off of Windows active
directory groups?
Thanks.
You can set the security with in SQL Server based on the NT users. You can
create a view that has the data that you wan the users to view and then
only give select permissions to the to those users.
In other words use teh security mechnism within SQL Server to set the
security.
Rand
This posting is provided "as is" with no warranties and confers no rights.
|||Thanks!
I use the dsnless connection string for trusted_connection
to base ithe permissions on the user.
However, the windows login box does pop up for them to
enter in username/pwd/domain.
Is there a way that sql grabs the user info automatically
and set the perms that way?
If I have a default page and links to an edit page, is
there a way to use the user info to disallow certain
people from entering that page?
Ngan
>--Original Message--
>You can set the security with in SQL Server based on the
NT users. You can
>create a view that has the data that you wan the users to
view and then
>only give select permissions to the to those users.
>In other words use teh security mechnism within SQL
Server to set the
>security.
>Rand
>This posting is provided "as is" with no warranties and
confers no rights.
>.
>
Sunday, February 12, 2012
Connect to SQL server through code?
I have an Access db that I need to link to a SQL Server table. I'd like to
do that through code, does anyknow how to do that?
(I'd like it run from several clients and I don't want do create a
ODBC-connection on every client.)
Thx!
/e
You'd want to post this in an Access newsgroup. Or check
this Access FAQ - it has sample code for linking tables:
http://www.mvps.org/access/tables/index.html
-Sue
On Tue, 22 May 2007 21:45:08 +0200, "eric"
<eric@.hotmail.com> wrote:
>Hi!
>I have an Access db that I need to link to a SQL Server table. I'd like to
>do that through code, does anyknow how to do that?
>(I'd like it run from several clients and I don't want do create a
>ODBC-connection on every client.)
>Thx!
>/e
>
Connect to SQL server through code?
I have an Access db that I need to link to a SQL Server table. I'd like to
do that through code, does anyknow how to do that?
(I'd like it run from several clients and I don't want do create a
ODBC-connection on every client.)
Thx!
/eYou'd want to post this in an Access newsgroup. Or check
this Access FAQ - it has sample code for linking tables:
http://www.mvps.org/access/tables/index.html
-Sue
On Tue, 22 May 2007 21:45:08 +0200, "eric"
<eric@.hotmail.com> wrote:
>Hi!
>I have an Access db that I need to link to a SQL Server table. I'd like to
>do that through code, does anyknow how to do that?
>(I'd like it run from several clients and I don't want do create a
>ODBC-connection on every client.)
>Thx!
>/e
>