Quantcast
Channel: SQL Server Data Access forum
Viewing all 4164 articles
Browse latest View live

Problem With OPENDATASOURCE And Microsoft.ACE.OLEDB.15.0

$
0
0

I have been using OPENATASOURCE and Microsoft.ACE.OLEDB.15.0 to access data from mdb files (ACCESS) for some time now and have never had a problem that I have been unable to address.

About a week ago I installed a copy of SQL Server 2016 on a new machine running Windows 10 and have been unable to access mdb files any more. I have tried re-installing, re-installing on a Windows Server 2016 machine and even using SQL Server Express but nothing I do cures the problem. I still have a Windows 10 development machine on which everything works without problems but cannot determine what is missing or causing the problem on new installations.

sp_configure 'show advanced options', 1
RECONFIGURE
GO
sp_configure 'Ad Hoc Distributed Queries', 1
RECONFIGURE
GO
SELECT TableNo, TableName FROM OPENDATASOURCE('Microsoft.ACE.OLEDB.15.0', 'Data Source=C:\Temp\TestSQL.mdb;Jet OLEDB:System database=C:\Temp\System.mdw;User Id=Admin;Password=admin;Jet OLEDB:Database Password=password')...ALocalAList
GO
sp_configure 'Ad Hoc Distributed Queries', 0
RECONFIGURE
GO
sp_configure 'show advanced options', 0
RECONFIGURE
GO

The code block above should work but unexpectedly results in the following error message:

Msg 7302, Level 16, State 1, Line 7
Cannot create an instance of OLE DB provider "MSDASC" for linked server "(null)".

Microsoft.ACE.OLEDB.15.0 has been properly registered and appears in the Server Objects \ Linked Servers \ Providers.

If I try and use Microsoft.ACE.OLEDB.12.0 I get the same error!

I would be most appreciative for any assistance in sorting out this problem.

Thank you.


Accessing a SQL server Database from a UWP c# application

$
0
0

Hi,

I was hoping someone may be able to point me in the right direction here. 

I am writing a simple app using visual studio community edition 2017 to record some data. However the application is unable to connect to our companies database server. (which is SQL Server 2016) 

I've installed and am using the System.Data.SqlClient Nuget package. 

I've tried to use a string as the connection string or use the built in connection string builder.

The message that appears when I try to open the connection, either with a server alias or using the servers IP address is..

{System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 40 - Could not open a connection to SQL Server)}

The Server Explorer in Visual Studio can connect to the database fine, and I can connect via Management Studio. I even tried to use the connection string generated within the sever explorer in the application, but this doesn't work either. 

I Don't even get a message within the logs on the SQL server stating that the application is trying to connect.

Now I installed a local version of SQL in order to test connections and this works absolutely fine. I can connect via 127.0.0.1 and browse, run stored procedures, update data etc from within my code from within the application. I've checked firewall settings, Copied over the setting from my local machine to the database server and managed to connect via 1433 to the server via telnet.

I've also worked through several connection troubleshooting guides I've found on google, but nothing has worked.

Does anyone have any ideas what may be the problem?

Many Thanks.


OLE DB provider "MSIDXS" has not been registered

$
0
0

Hi,

I am getting an error while executing a linked server, OLE DB provider "MSIDXS" has not been registered. I have installed Windows Search service , and it is up and running fine. I have Windows Server 2016 Standard 64 bit and SQL server 2016 Enterprise 64 bit. When I see the list of OLE DB provider in SQL server linked server, “Microsoft OLE DB provider for Indexing Service” is not listed. Please advise.

Configure the order of Network Protocols

$
0
0

Hi,

When we configure the order of Network Protocols using SQL Server Configuration Manager>SQL Native Client > Client Protocols on the machine hosting MS SQL instances, should we also config the protocols order on client side using cliconfg.exe? on client side (server hosting the application) when I start cliconfg.exe "Enabled Protocols" list is empty is this normal ?

Best regards


Operand type clash: varchar is incompatible with varchar(100) encryptedwith (encryption_type = 'DETERMINISTIC', encryption_algorithm_name = 'AEAD_AES_256_CBC_HMAC_SHA_256',

$
0
0

Hi,

While Creating Store Procedure on encrypted column, getting below mentioned error. Someone please guide me how we can create stored procedure, OR Remove Collation from respective column? 

Is there any implication, if we removed collation from columns ? how we can handle this in Encryption. ?

How to handle this.

Please suggest. 

Operand type clash: varchar is incompatible with varchar(100) encrypted with (encryption_type = 'DETERMINISTIC', encryption_algorithm_name = 'AEAD_AES_256_CBC_HMAC_SHA_256', column_encryption_key_name = 'CEK_Auto1', column_encryption_key_database_name = 'CompanyName') collation_name = 'Latin1_General_BIN2'

R,

Abhishesh Pandey 

The File location cannot be opened. Either access is not enabled or you do not have permissions for the same.

$
0
0

Can explore sql server file stream share by windows explore but File table context menu "Explore FileTable Directory" throws

The File location cannot be opened. Either access is not enabled or you do not have permissions for the same.

Sql server Service properties, Sql Server node properties and Database properties all set as required for File Stream access

Did all possible check and follow most of the suggestions on various blogs, still no luck seems like still some thing is missing

Help Please.


DA

how can grouped more than one rows in sql

$
0
0
In education database I have a view that it shows the courses. And
I have defined several sessions for some courses. now I want to show this session of the unit that has the same <g class="gr_ gr_9 gr-alert gr_spell gr_disable_anim_appear ContextualSpelling ins-del multiReplace" data-gr-id="9" id="9">CoursId</g> together. can I use GroupBy for this ?!
how can I do this correctly?!

Wired random timeout expired issue in both ODBC and Oledb DataAdapter.Fill

$
0
0

I have a web application running in Windows Server 2008 SP2/64bit/IIS 7/ASP.Net Framework 2.0. This web application is connecting to a MSSQL server located in the same box(MS SQL 2008 R2 SP1 64bit). In 99% of the time, the web app is working fine, however sometimes I encountered timeout expired issue in some queries which they are used to work perfectly fine.

The issue usually happened when using the DataAdapter.Fill to fill a select query into a dataset. These queries can be as simple as "select * from table_A" and return only 20+ rows. If I remove any 1 row from or add 1 new row into the table, the query can work. If I trim any field in any row, the query can work. If I wrap this query in a stored procedure and call the stored procedure, it can work. 

I have tested ODBC, Oledb and sqlClient driver, only sqlClient works without changing the data or query. Below is the detailed exception:

System.Data.Odbc.OdbcException: ERROR [HYT00] [Microsoft][ODBC SQL Server Driver]Timeout expired
  at System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode)
  at System.Data.Odbc.OdbcDataReader.GetData(Int32 i, SQL_C sqlctype, Int32 cb, Int32& cbActualOut)
  at System.Data.Odbc.OdbcDataReader.internalGetString(Int32 i)
  at System.Data.Odbc.OdbcDataReader.GetValue(Int32 i)
  at System.Data.Odbc.OdbcDataReader.GetValues(Object[] values)
  at System.Data.ProviderBase.DataReaderContainer.CommonLanguageSubsetDataReader.GetValues(Object[] values)
  at System.Data.ProviderBase.SchemaMapping.LoadDataRow()
  at System.Data.Common.DataAdapter.FillLoadDataRow(SchemaMapping mapping)
  at System.Data.Common.DataAdapter.FillFromReader(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue)
  at System.Data.Common.DataAdapter.Fill(DataSet dataSet, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
  at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
  at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
  at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)

====================================================================================

System.Data.OleDb.OleDbException: Timeout expired
  at System.Data.OleDb.OleDbDataReader.ProcessResults(OleDbHResult hr)
  at System.Data.OleDb.OleDbDataReader.GetRowHandles()
  at System.Data.OleDb.OleDbDataReader.ReadRowset()
  at System.Data.OleDb.OleDbDataReader.Read()
  at System.Data.Common.DataAdapter.FillLoadDataRow(SchemaMapping mapping)
  at System.Data.Common.DataAdapter.FillFromReader(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue)
  at System.Data.Common.DataAdapter.Fill(DataSet dataSet, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
  at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
  at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
  at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)


kragon


Connect to Dedicated Admin Connection from C#

$
0
0
Hey. I need to perform database queries through the DAC from the c # application. I am using Ado.NET but I get an exception. How are there more ways? The database and application are on the same machine.

ODBC SQLError() vs SQLGetDiagRec() which to use?

$
0
0
could anyone explain whether i should call SQLError() or SQLGetDiagRec() in my ODBC programs? i know SQLDiagRec() is newer but it seems as if SQLError() is less tedious to call when multiple error records occur from an ODBC API function.  Is there any reason i should stay away from using SQLError() instead of SQLGetDiagRec()?

sys.geometry is invalid; Parameter Type 'Value'

$
0
0
Hi,
Whenever i tried to edit my geodatabase data in SQLServer Management Studio 2012, encountered with an error of sys.geometry is invalid Parameter Type 'Value'. Anyone can help me to resolve this issue??

SQLR ODBC Driver 13 for SQL Server Issue with Nvarchar(max) with TLS 1.2

$
0
0

We are trying to connect Microsoft ODBC Driver 13 for SQL Server (TLS 1.2 Supported) to run SQL R in one of the procedure through RxSqlServerData. While running the procedure it shows all the data but shows NULL for Nvarchar(max). I tried to run sample query to produce the result but it showed the NULL value in client machine. Can someone advise? We cannot use OLEDB driver as SQLR doenot support this and also we cannot cast it as Nvarchar(4000) as the data can be more than NVARCHAR(4000).

                                                                                                                                                                                            

--create login [dbrownesqlvm\SQLRUserGroup] from windows

declare @sql nvarchar(max) = N'select name, cast(name as nvarchar(max)) n from sys.objects'    

declare @ConnectionString nvarchar(max) = 'DRIVER={ODBC Driver 13 for SQL Server}; Server=localhost; Database=tempdb;Trusted_Connection=yes; '  

exec sp_execute_external_script      

 @language = N'R'        
,@script=N'    

    data <- RxSqlServerData( sqlQuery = sql, connectionString = ConnectionString) ;   
    print( data )
    final_result <- rxDataStep(data)

'      
,@input_data_1 = N''    
,@output_data_1_name=N'final_result'      
,@params = N'@ConnectionString NVARCHAR(2000), @sql NVARCHAR(2000)'    
,@ConnectionString = @ConnectionString    
,@sql = @sql    


vishal gupta

SQL server for boolean data (True=1) and (False =0)

$
0
0

Hello SQL Community,

I am having issue importing csv file with Boolean data into sql . Has anyone encountered these issues before?

Basically ,I need to import flat file source with Boolean data type. 


Regards,

Tan

Using Python Language to connect it to SQL Server

$
0
0

Hello SQL Community,

Has anyone used Python Language to connect it to SQL Server ?

Regards,

Tan

Error when importing flat file source data

$
0
0

Hello guys,

Does anyone know why I cannot import csv flat file source successfully?

Regards,

Andrew


Issue to connect to SQL server from .net application

$
0
0

We have two servers with windows server 2016, Server A is hosting a default instance of SQL 2016 and server B (client) is hosting a .net application

From Server B we can connect to SQL instance on Server A using the following tools/methods
- SSMS
- SQLCMD
- TelNet
- ODBC and UDL files

But we are not able to connect using the .net application (that uses ADO SQLConnection class), in the connection string we tried both the name of the server and IP adr but without success, if we copy the .net App on Server A it's working properly (probably because this is using a shared proctocol and not the TCP/IP protocol as both SQL and .net app are on same server)

My question:
is the .net application use a different drivers than SSMS and the other tools I mentionned? do you have an idea how to troubleshoot  this issue?

The Server A is configured with the following orders and seetings
Share Memory enabled
TCP/IP enabled
Named Pipes desabled

Message Error:

A network-related or instance-specific error occurred while establishing a connection to SQL Server.

The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.


Thanx for your help and feedbacks





Grant Access to SQL Server Table to AD user

$
0
0

I'm new to MS SQL Server and need to grant read-only access to certain tables to a certain user in an Active Directory group. I would prefer to do this in the SSMS GUI but have forgotten how and have not been able to find documentation. Where could I find this?

Here's what I've tried:

  1. Selected the SQL Server server and logged into SSMS.
  2. In the Object Explorer, expanded Logins. I see only two users listed: my own and one other. Both have the icon for a single user, not an AD group.
  3. Expanded Server Roles. Here several roles are listed, including "public." But when I right-click these and choose Properties, I see only the owner or myself listed.

Do I just not have permission to see the user I need to see, or am I doing it wrong?

Access SQL 2016 instance from Windows Server 2008 Standard Edition

$
0
0

Hi,

We have .net application running on windows server 2008 standard edition. We are trying to connect a SQL 2016 instance. Where can we find the SQL native client can be installed on Server 2008 Standard Edition? 

Thanks, 

SQL Server Agent job

$
0
0

When I run the job I get this error.

Access to the remote server is denied because the current security context is not trusted. [SQLSTATE 42000] (Error 15274).  The step failed.

My setup

Sql Database - Database_Name

Database Owner sa

Sql Job is owned by a user

Stored procedure has Execute By Owner

Stored running queries against the Link Server

Link Server Setup

EXEC

master.dbo.sp_addlinkedserver@server=N'DWD',@srvproduct=N'Oracle',@provider=N'OraOLEDB.Oracle',@datasrc=N'dwd.world'


/* For security reasons the linked server remote logins password is changed with ######## */


EXEC

master.dbo.sp_addlinkedsrvlogin@rmtsrvname=N'DWD',@useself=N'True',@locallogin=NULL,@rmtuser=NULL,@rmtpassword=NULL


EXEC

master.dbo.sp_addlinkedsrvlogin@rmtsrvname=N'DWD',@useself=N'False',@locallogin=N'Domain\user',@rmtuser=N'useraccount',@rmtpassword='password'

Operand type clash: varchar is incompatible with varchar(100) encryptedwith (encryption_type = 'DETERMINISTIC', encryption_algorithm_name = 'AEAD_AES_256_CBC_HMAC_SHA_256',

$
0
0

Hi,

While Creating Store Procedure on encrypted column, getting below mentioned error. Someone please guide me how we can create stored procedure, OR Remove Collation from respective column? 

Is there any implication, if we removed collation from columns ? how we can handle this in Encryption. ?

How to handle this.

Please suggest. 

Operand type clash: varchar is incompatible with varchar(100) encrypted with (encryption_type = 'DETERMINISTIC', encryption_algorithm_name = 'AEAD_AES_256_CBC_HMAC_SHA_256', column_encryption_key_name = 'CEK_Auto1', column_encryption_key_database_name = 'CompanyName') collation_name = 'Latin1_General_BIN2'

R,

Abhishesh Pandey 

Viewing all 4164 articles
Browse latest View live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>