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

ACE.OLEDB compatibility issue between SQL and Visual Studio

$
0
0

Seems there are significant issues between SQL Server and Visual studio related to ACE.OLEDB drivers. 

The issue stems from 32 bit and 64 bit conflicts between Windows 10, SQL Server, and Visual Studio.

I keep getting an error trying to connect to an Excel spread sheet for an SSIS package. 

Visual Studio wants one bit version and SQL wants the other. 

The two don't seem to be able to play well together. 

So I am left with a situation where when I test in development and get things running, moving that to prod will break the connection to the Excel file due to the 32/64 bit ACE driver. Unreal. 

Any help would be appreciated. 

I am amazed that MS has not created a cross over driver to solve their problem. 

Thanks, 


Error connecting to remote SQL server

$
0
0

I work for a client that has a web site driven by a SQL server database. There is one server with the web site on it and the SQL server is another system in the datacenter. My client has a named instance on it.

Remotely I get to the SQL database by using ABCompany.net (not the actual name) in SSMS. There are some remote Access databases that use ABCcompany.net in their connection string as well. Somehow the network folks have ABCcompany.net pointing to the correct SQL instance. This has worked well for several years. However, the last few months I’ll sometimes get (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 53) while trying to open in SSMS.

If the web server is rebooted it will work again, but it’s getting to the point this has to be done several times a day.

The network folks can’t seem to figure it out, so I’m looking for ideas.


Jim Brown

'Microsoft.ACE.OLEDB.12.0' provider not working in 64 bit Windows 10 and office 16

$
0
0

How to fix the error "The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine." on Windows 10 64 bit PC, 64 bit Office 2016.
I am receiving this error when I try to import .xlsx thru "SQL Server Import and Export Wizard" and also thru SSIS.
I've installed 64 bit ACE Provider and still getting the same error.

Any help is highly appreciated.

Thanks


'Microsoft.ACE.OLEDB.12.0' provider not working in 64 bit Windows 10 and office 2016

$
0
0

How to fix the error "The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine." on Windows 10 64 bit PC, 64 bit Office 2016.
I am receiving this error when I try to import .xlsx thru "SQL Server Import and Export Wizard" and also thru SSIS.
I've installed 64 bit ACE Provider and still getting the same error.

Any help is highly appreciated.

Thanks



The format used to define the new variable for Invoke-Sqlcmd cmdlet is invalid. Please use the 'var=value' format for defining a new variable

$
0
0

I am calling a sql script from ps and passing a variable to it. 

Here is the content of zzzz.sql

select * from Translation where nTranslationID=777
print $(tempKEY)

Here is the content of zzz.ps1

$var= 'https://junkfiles.blob.core.windows.net/some-folder?sv=2019-02-02&sr=c&sig=HOtd1AorRfYtimAJY5PeVJikKiTYgcs81QeASqpXPec%3D&se=2019-11-02T17%3A42%3A01Z&sp=rw'

invoke-Sqlcmd -ServerInstance 'db1' -Database 'whatsup' -Username 'zzzzz' -Password '******' -Variable "tempKEY='$var'" -InputFile "c:\temp\zzzz.sql" -Verbose 4>&1 | Tee-Object -Variable statistics

The = signs in the variable are causing the error. Is there a way to escape the = signs ?

Thanks 

Timeout error while attempting to consume the pre-login handshake

$
0
0

We're are experiencing isolated issues where our .NET application is failing to connect to a remote SQL server database with the following error:

System.Data.SqlClient.SqlException (0x80131904): Connection Timeout Expired.  The timeout period elapsed while attempting to consume the pre-login handshake acknowledgement.  This could be because the pre-login handshake failed or the server was unable to respond back in time.  The duration spent while attempting to connect to this server was - [Pre-Login] initialization=14672; handshake=13498;  ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out

The SQL server is SQL Server 2008 R2, and is configured for Named Pipes and TCP/IP.   On some client machines we are able to connect without issues.  On others, we're only able to connect if we disable Named Pipes.

I am not clear on what client environment settings, software, etc... would cause this error to occur.  Any help in understanding this situation would be greatly appreciated.

How can we audit how often a report is used from the DR?

$
0
0
I would like to audit the use of reports in our data repository.

Linked Server Issue for OraOLEDB

$
0
0

Hi All

Some users are experiencing the following error when they try to test a connection to an Oracle Linked server:

Cannot initialize the data source object of OLE DB provider "OraOLEDB.Oracle" for linked server "<name>". OLE DB provider "OraOLEDB.Oracle" for linked server "<name>" returned message "ORA-12541: TNS:no listener" (Microsoft SQL Server, Error 7303)

This is on SQL Server 2012 (SP4-GDR) (KB4057116) - 11.0.7462.6 (X64)

This linked server connection used to work successfully for them and the strange thing is that it works for me without any issue.

Does anyone have any idea how to resolve this?

Many Thanks,

Phil


Connect to SQL Server Database in another Domain with no Internet

$
0
0

Hi,

I've read most of the connection problems posted in this forum.  None seems to address my case.

My dev machine is on our local LAN in one domain.  Another domain contains my target database.  The server hosting that database is configured as a domain server/controller.  I'm accessing that database from my dev machine using the following connection string:

"Network Library=DBMSSOCN;Data Source =ipaddress;Initial Catalog=dbname;User id=username; password=pwd"

It doesn't work.  The user has the necessary access rights to the domain server and the target SQL server.

Why isn't this connection string working?  The error I get is:

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. 

I've verified that the SQL Server Instance name is correct.  The server can only be accessed using the IP Address since when I ping the server name, it cannot find it.  But if I ping using the IP address, it finds it (from my dev machine).

Any thoughts?  Appreciate any help.


Marilyn Gambone

ADO and the MSOLEDBSQL provider

$
0
0

I have a VB6 application that is currently using MSDASQL as the provider with ADO. I am looking to start using the newer MSOLEDBSQL provider. All is well and I can connect to my database however if I try to execute a stored procedure which return a value I am not getting any return values in my recordset. 

I have included both my code and the stored procedure below.

Has anyone else come across this issue as I am struggling to find any info on the net.

Stored Procedure:

Create Procedure [dbo].[InsertRecUserLogonAudit]
    @UserLogOnApp VarChar(50), 
    @UserLogOnDate DateTime, 
    @UserLogOnUserID VarChar(50), 
    @UserLogOnPassword VarChar(50), 
    @UserWindowsName VarChar(255), 
    @UserPCName VarChar(255), 
    @UserLogOnMsg Text, 
    @UserLogOffDate DateTime As 

Declare @ChangeTime Datetime

Declare @LogCode Decimal(9,0)

Set @ChangeTime = GetDate()

Insert Into UserLogonAudit(UserLogOnApp, UserLogOnDate, UserLogOnUserID, UserLogOnPassword, UserWindowsName, UserPCName, UserLogOnMsg, UserLogOffDate)
  Values(@UserLogOnApp, @UserLogOnDate, @UserLogOnUserID, @UserLogOnPassword, @UserWindowsName, @UserPCName, @UserLogOnMsg, @UserLogOffDate)

Set @LogCode = (Select @@Identity)


Select @LogCode
GO

VB6 Code:

SysConnectionString = "Provider=MSOLEDBSQL; Driver={SQL Server}; DataTypeCompatibility=80; Server=" & SysServer & "; Database=" & SysDatabase & "; UID=TTExe; PWD=" & SysTTExePassword$ & "; 

adoConnectAudit.CommandTimeout = 120
adoConnectAudit.Open SysConnectionString

' Create logon audit record, get last identity value
SQLCmd = SQLCmd & "Execute InsertRecUserLogonAudit "
SQLCmd = SQLCmd & "'" & App.Title & "', {ts'" & Format$(Now, "yyyy-mm-dd hh:mm:ss") & "'}"
SQLCmd = SQLCmd & ", '" & UserID & "', '" & SysEncrypt.EncodeString(PassWord) & "'"
SQLCmd = SQLCmd & ", '" & GetThisUserName & "', '" & GetThisComputerName & "', '', Null" & vbCrLf '

Set adoResult = adoConnectAudit.Execute(SQLCmd)
SysLogonAuditRecord = adoResult.Fields(0)


SQL 2016 - Oracle OLEDB (ODTwithODAC122011) - Cannot Create Instance - Access Denied

$
0
0

Hello All,

Any assistance is appreciated and thank you!

Environment:

   - Host:  Windows 2016 Std.

    - SQL Server: 2016 Ent - 13.0.5479.0

I'm engaged in a Linked Server\ Oracle ODAC battle!

Test connect via UDL - Successful

Test connect  OLEDB linked server - Successful

SSMS - Execute Query

SELECT

*FROMOPENQUERY(EXADATA,' SELECT SYSDATE FROM DUAL')

The following errors, are raised depending on OLEDB.Oracle provider properties.

Msg 7399, Level 16, State 1, Line 1

The OLE DB provider "OraOLEDB.Oracle" for linked server "EXADATA" reported an error. Access denied.

Msg 7350, Level 16, State 2, Line 1

Cannot get the column information from OLE DB provider "OraOLEDB.Oracle" for linked server "EXADATA".

OR

Cannot createan instance ofOLE DB provider"OraOLEDB.Oracle"forlinkedserver"EXADATA".(MicrosoftSQLServer,Error:7302)


Covi







ODBC using fixed Windows login from non-AD computer? Possible?

$
0
0

We have an outside company that needs access to one of our databases, which is hosted on a HAG.  They want a simple SQL user created, but we try to avoid SQL users in favor of Windows/Domain users/groups.  Domain auth is easier, as there are no messy SID's to line up across servers, or to migrate when it's new server season.

So, this company says they are using an ODBC connection.  Which leads me to ask:  Is there a way to force/fudge a SQL ODBC connection into using a specific "Windows login/authentication" for a System DSN, and when that system is on a foreign network and has no AD trust relationship?

Not really expecting anything but a "not possible" on this one, but if it were it'd be cool to learn something new.

Thanks in advance.

Login Failed For User

$
0
0

After a plethora problems I was finally able to connect to my SQL Server but now I have new error.
When I run my JDBC file on Eclipse I get a Login Failed For User error

Here is the code:

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class DBMS {
    // Connect to your database.
    // Replace server name, username, and password with your credentials
    public static void main(String[] args) {
        String connectionUrl =
                "jdbc:sqlserver://DESKTOP-OR0284J:1433;"+ "database=Computer_Builds;"+ "username=Kishore;"+ "password=admin;"
                        ;

        try (Connection connection = DriverManager.getConnection(connectionUrl);) {
            System.out.print("Hello");
        	// Code here.
        }
        // Handle any errors that may have occurred.
        catch (SQLException e) {
            e.printStackTrace();
        }
    }
}

And error: 

com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'Kishore'. ClientConnectionId:28a940d0-cabf-4235-9ea1-3dfebcf1bf06
	at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:217)
	at com.microsoft.sqlserver.jdbc.TDSTokenHandler.onEOF(tdsparser.java:279)
	at com.microsoft.sqlserver.jdbc.TDSParser.parse(tdsparser.java:99)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(SQLServerConnection.java:4346)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:3160)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.access$100(SQLServerConnection.java:43)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(SQLServerConnection.java:3123)
	at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7505)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2445)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1981)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:1628)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:1459)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:773)
	at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1168)
	at java.sql.DriverManager.getConnection(DriverManager.java:664)
	at java.sql.DriverManager.getConnection(DriverManager.java:270)
	at DBMS.main(DBMS.java:16)

I am using the right username and password.

Please help me out.

Accessing SQL server via Linux ODBC with windows authentication

$
0
0

Hi,

I am trying to access an SQL server instance (which is configured for mixed mode authentication) via a linux machine using the mssql ODBC 17.4 Driver. In doing so, I am able to successfully connect using sql authentication. But how do I connect to the database using windows authentication ? How can I send over the UID and Password for a particular domain that the sql server authenticates against ? I have gone through the docs, and there is a setting for Azure AD but not for an internal hosted AD. I tried to using Authentication=ActiveDirectoryPassword (meant for Azure AD) in the hopes that it would work same for internal AD but it didnt. I keep getting a "Login failed for user". I have given the UID in format of DOMAIN/USER. Can any one please assist on this ?

SQL Server ODBC + eventlet non-blocking IO hangs and weird behavior

$
0
0

Hi, this new question is made in reference to (https://social.technet.microsoft.com/Forums/sqlserver/en-US/9e5b6d96-f9a2-4249-bd39-7f997165c502/sql-server-odbc-experimenting-with-eventlet-nonblocking-io-results-in-segfaults-sometimes?forum=sqldataaccess)

It didn't receive any replies, but the issue of segfaults seems to have been fixed as I'm unable to reproduce the problem as of late. So thanks very much if some work was done in regard to the segfault.

The problem of async IO communication with SQL Server doesn't seem to be solved though.

Using the test app found here (https://github.com/bpaterni/flask-app-simple-blocking-eventlet)

If no changes are made to the way connections are setup, the app seems to be able to handle a small number of requests (< 15) at the same time alright, but if the number of requests ventures beyond that, the app will hang seemingly indefinitely until it's interrupted (Ctrl-C). From there, one or a few requests throw an exception (presumably the ones being worked on at the time of the interrupt?), and the app continues processing requests that weren't subject to the hang or the interrupt.

If on the other hand - on the suggestion of an eventlet developer (https://github.com/eventlet/eventlet/issues/538) - I switch to using a Tpooled connection pool creator, the app begins to behave similar to expectations for an async app. But if the max number of pool slots is arbitrarily high (~35) or unlimited, a hang sill occurs if load exceeds this threshold.

Is it possible for the ODBC driver to be augmented in such a way to not hang in the cases described above, and possibly behave more asynchronously without explicitly telling sqlalchemy to use a Tpooled connection pool?

Thank you very much for your help! :)


Connect to SQL Server with seek and index support

$
0
0

Hello,

I am a programmer, at work we use Harbour (https://harbour.github.io/) and we would like to convert our application to SQL Server. Our problem is that harbour (like Clipper and Fox pro) uses a RDD interface.

We are able to implement an RDD interface with any API, our problem is that none of them looks supports seek...

We tryied ADODB https://stackoverflow.com/questions/54746974/adodb-sqlserver-connection-with-seek-and-index

and OLEDB https://stackoverflow.com/questions/58839237/how-to-check-if-ole-db-drivers-supports-opening-indexes-through-iopenrowset

There is a way to connect to SQL server, take a table and set ordering and go to a value by index values?

Thanks,

Antonino

Cannot Link to a local SQL Server Express Database

$
0
0

Hi,

I'm trying to reproduce an environment my client has on his computer.  He has an Access 2003 adp file with his code and a SQL Server Express database.  I have both the database and Access code installed on my computer.

However, the Access adp file will not connect to the SQLServer Express database.  The error message says " Cannot find the database or access is denied".  I cannot even create an ODBC entry using a SQL Server or SQL Server Native Client driver.

I'm starting to think there is some driver missing in my Windows 7 computer.

Any ideas?

Thanks, Alan

Connection Failed: SQLState: '01S00'

$
0
0

We have a client that is dropping their database connection a few times a day. It works most of the time, but at intermittent times during the day the connection drops to different workstation. We believe this is a network related issue as our application is used by many other clients that are not having this issue.

To try to resolve this issue we used Microsoft Message Analyzer.  Using this we found a message that may be related, but are not sure what the message is point to.  The message is:

Parsing\tActor: OpnGenerated.TDS_actor_TDSOverTCP+TDSOverTCP
Exception: Cannot cast optional Microsoft.Opn.Runtime.Values.ArrayValue`1[OpnGenerated.TDS+ColumnData] to Microsoft.Opn.Runtime.Values.ArrayValue`1[OpnGenerated.TDS+ColumnData] because the value is 'nothing'.
Hash Code: 17b34b2ab195ef5f5ff8bb2bdbb0a4f7
Call Stack:
   at Microsoft.Opn.Runtime.Values.OptionalValue`1.get_Value()
   at OpnGenerated.TDS.DecodeAllColumnData(COLMETADATA colMetaDataTemp, StreamValue payloadStream, String fieldName, String messageName)
   at OpnGenerated.TDS.TabularResultPacketDataDecoder(StreamValue payloadStream, UInt32 tdsVersion, MessageValue msg)
   at OpnGenerated.TDS_CG.TabularResult_BinaryCodecCompiler.__Decode(StreamValue sv, Object[] args)
   at OpnGenerated.TDS.TDSDecodingCache.DecodeTDS(StreamValue s)
   at OpnGenerated.TCP.TCPDecodingCache.TryDecodeAndDispatchMessage()
   at OpnGenerated.TDS.TDSDecodingHelper.TryDecodeTdsAndTls(Segment s, Int32 direction)
   at Microsoft.Opn.Runtime.Actors.MessageEvent.Execute(MessageEventHandler handler, MessageEventArgs args)

Our Client application is a MS Access 2010 Runtime application.  Is this the Runtime that is being referenced in this message?  I have tried many Internet searches on this and nothing of any value is produced.  I am hoping I can get some guidance on this from this forum.

Regards,

Robert

Implementing Connect As Different User from within the Connection String with Windows Authentication

$
0
0

We have two domains.  Ours is on Windows 2012 (dom2012)Sister companies domain is on Windows 2003 (dom2003)

Domain SIDs are different or not synched, etc.  due to Exchange implementation on both sides, etc. etc.

So, the Domain Trust works only one way.  Users in dom2012\userA can connect to dom2003 SQL Servers with WinAuth, but not the other way around.  The only way is in dom2003 users to use SSMS Connect as Different User and enter their dom2012\userX and access to SQL Servers in dom2012.  (similar to /Run as from command line, etc.) 

So the question is: Is there any way to simulate this with a Connection String.  In other words, the connection string will be something like this: server=abcdef; Trusted_Connection=Yes; Integrated_Security=SSPI; uid=dom2012\user...…..

But in that case, you still have to specify a password so that the connection string inside the ConnString will find the SID.

I guess that is not possible, right?

Thank you

Lovely Cornelia from Boston


how to grant SQL Server permission to read from UNC path

$
0
0
I have a stored procedure that reads a flat file with OPENROWSET. If the data file and format file both exist on the network with a UNC path, how do I enable the SQL Server to read the files? We are a large organization and use active directory groups. If I submit a request this should be done for me on the production server, but I need to know how to do it on the test server which I control.
Viewing all 4164 articles
Browse latest View live


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