API Only Returning 600 Results
oledb consumer templates future
Hi,
I am curious what are the MS plans for OleDB? I keep reading that it will no longer be supported but, I did not see any info regarding what will replace it? If it is replaced by ODBC, is there going to be a set of C++ classes similar to those existing today in Oledb consumer templates?
Please note that I am interested in native C++ not any managed stuff.
Thanks,
G.
How to install and register Microsoft OLE DB Provider for Oracle on Windows Server 2003 R2 Enterprise x64 Edition with SQL Server 2005 Enterprise Edition (64-bit) SP4
How to correctly install and register Microsoft OLE DB Provider for Oracle
on Windows Server 2003 R2 Enterprisex64 Edition for the goal of creating of linked server within SQL Server 2005 Enterprise Edition (64-bit) SP4 ?
MDAC 2.8 SDK were installed.
C:\Program Files (x86)\Common Files\System\Ole DB
folder contains files
msdaora.dll and msdaorar.dll,
but this is not true for the list of providers in the SQL Server 2005 !
Changing existing OLEDB application from SQLOLEDB to use MSDASQL
I have an existing application which uses SQLOLEDB to connect to SQL database. Since SQLOLEDB is deprecated, I am looking for an easier alternative to move to some thing which is not deprecated. One option is to obviously move to ODBC but that would require lot of change. Instead, I was thinking about using MADASQL since the client code is already OLEDB, and probably I would need to make change only in the connection part.
But I am not finding any documentation or sample code which will help me in this. All the sample code that I found was for conversion of ADO application where only the connection string needs change. I did not find anything for moving from SQLOLEDB
to MSDASQL.
This is what my existing code does.
Step 1
CoCreateInstance(CLSID_SQLOLEDB,NULL,CLSCTX_INPROC_SERVER,IID_IDBInitialize,(void**)ppIDBInitialize);
Step 2
InitProperties[0].dwPropertyID = DBPROP_INIT_PROMPT;
InitProperties[0].vValue.vt = VT_I2;
InitProperties[0].vValue.iVal = DBPROMPT_NOPROMPT;
Similarly following properties are set
DBPROP_INIT_DATASOURCE with value "sqlservername\instancename"
DBPROP_INIT_CATALOG with value "databasename"
DBPROP_AUTH_INTEGRATED with value empty string
DBPROP_INIT_TIMEOUT with 30
pIDBInitialize->QueryInterface(IID_IDBProperties, (void**)&pIDBProperties);
hr = pIDBProperties->SetProperties(1, &rgInitPropSet);
Step 3
UINT hr = (*ppIDBInitialize)->Initialize();
- I changed the CLSID to “CLSID_MSDASQL”, and first call is successful.
- Based on the documentation at https://docs.microsoft.com/en-us/sql/ado/guide/appendixes/microsoft-ole-db-provider-for-odbc , I have tried several alternatives of below properties.
- Along with these 5 properties, I tried adding DBPROP_PROVIDERFILENAME or DBPROP_PROVIDERFRIENDLYNAME with value “MSDASQL”. But SetProperties fails with DB_S_ERRORSOCCURRED, and Initialize call fails with error "[Microsoft][ODBC Driver Manager] Data source
name not found and no default driver specified"
- I have also tried adding KAGPROP_DRIVERNAME with value “SQL Server” or “MSDASQL”, DBPROP_INIT_PROVIDERSTRING with value “MSDASQL” or “Provider=MSDASQL” or “Provider=MSDASQL;” etc.
How can I change the existing code to make use of MSDASQL? Or my approach itself is wrong, and there is no alternative to moving to ODBC?
Thanks,
-Nilesh.
Can SQLOLEDB work without TLS 1.0 enabled on the SQL Server?
I need to confirm if SQLOLEDB provider can work when TLS 1.0 is disabled. I have to disable TLS 1.0 for security reasons but I have a number of users who connect via SQLOLEDB and so far, I have been unable to connect via SQLOLEDB when TLS 1.0 is disabled.
I am successful with the newer SQLNCLI11 client and would prefer that but many of these users do not have it installed and I need to confirm SQLOLEDB is not going to work before I force the issue with them. Most of the users use Excel 2010 and do a data connection to SQL Server. They end up with a connection string such as:
Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=True;Initial Catalog=Reporting;Data Source=myserver.mycompany.com;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=MYWORKST1234;Use Encryption for Data=False;Tag with column collation when possible=False
I have tried many different versions of that connection string and have toggled TLS 1.0 on/off. I cannot get SQLOLEDB provider to work with TLS 1.0 is off. Is it possible? If so, what should the connection string look like?
rp
Is the move to ODBC and away from OLEDB still on?
Hi,
I have not seen anything new on this lately so I am curious if MS is still moving away from OLEDB toward supporting ODBC only MSSQL access?
Thanks,
GT.
can a domain trust a non-domain source like SQL? for desktop login?
We have a SQL based authentication and authorization engine. Now, we are enabling active directory for our production boxes. With this, we have a challenge wherein during a machine / desktop login, we want the active directory to integrate with this non-AD source like SQL for user authentication and authorization. Is this possible?? also, we wanted to check if RADIUS communication can do this??
Building winform with MS SQL Server.
We are developing a basic software for one of our client. Where we need to use Winform and MS SQL Server. Basically, user will fill data through winform and after save data will store to MS SQL server. And when needed they will query the database using Winform or similar method. We might have 5-6 users for use this system.
Now we want to make a physical server for them. If we want to use slandered license what I need to do? Purchase a stander license (cost might be around $1000) then do I need to purchase any cal for each user (cal might be around $200)? If I need to purchase cal for each users then I don’t have any idea how to integrate cal with those with Visual Studio project.
Or If I setup MSSQL stander edition I don’t need cal for winform connection?
Can I configure the default isolation level for all my SSRS reports.
By default connections to SQL Server are made Read Committed. However in a lot of situation this can result on locking of other users when a big SSRS report is executing. Is there a way to configure my SSRS server that it will connect by default with isolation level Read Uncommited to the database.
At this moment you need to specify the transaction isolation level in every dataset of the report. This will result in problems of somebody forget to specify. By configuring this on server or connection level, you know for sure that all reports are executing with Read Uncommitted.
More information about this topic canbe found on my blog: http://www.keepitsimpleandfast.com/2010/11/bad-performance-and-lockings-occur-ad.html
isolate sql db from the cloud live version to a local network
Problems with MSOLEDBSQL and Shape SQL
There seem to be a few gaps in this implementation with ADO
1) If the sql is parameterized shape SQL, the driver will not recognize parameters in appended shape selects.
One gets a parameter not specified error. Same Shape SQL works fine with SQLOLEDB.1
2) If the child query contains a reference to a temp table, we get an invalid object error. Sql trace shows that the SPID changes between the parent query and the child (it explains the error but why the change?). These issues do not exist with SQLOLEDB or, even with MSOLEDBSQL if parameter and temp table appear only in the top query.
Any effort to make MSOLEDBSQL work in these circumstances would be greatly appreciated.
[Resolved] OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)" returned message "Unspecified error". SQL Server
ISSUE:OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)" returned message "Unspecified error".
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)".
PROBLEM: OPENDATASOURCE query execution error while using SQL public account
SOLUTION:
If user:
+ A Windows account
+ SQL Public account
+ No Administrator privileges to the server
SQL Server Services:
+ Running as a Domain service account
+ Not log on as Local System or Local Service or Network Service
Do the following:
Give domain user\group modified permission (NT Read/Write) to this directory \\SERVER\c$\Users\sqlserviceaccount\AppData\Local\Temp
- Sqlserviceaccount is the account that is running as SQL Server Services
Ref:
(https://blogs.msdn.microsoft.com/docast/2015/07/21/opendatasource-query-execution-error-while-using-sql-public-account/)
https://blogs.msdn.microsoft.com/docast/2015/07/21/opendatasource-query-execution-error-while-using-sql-public-account/
https://visakhm.blogspot.com/2013/12/how-to-solve-microsoftaceoledb120-error.html
Linked server querying "big" oracle views : performance issue
Let's say I want to do a select count(*) from LinkedServer..Schema.View where statement.
Schema.View is my Oracle view.
Working with OLEDB provider, the first step is the createsession, then oledb does an openRowSet on the view with max rows = 1 (kind of top 1) and without the where filter. Then it does a Get Column Info and then the command begins (fast because there is a filter).
I don't understand why this GetColumnInfo occurs before the command and it's a real problem because my view is very big. So SQL Server queries a very big view on oracle and then only get 1 row to get the metadata. It's performance killing ...
If I use OpenQuery, I don't have these steps before the command. Unfortunately in my case I can not use this (unpredictable SQL)
Questions :
- Why this kind of "dirty" query to get the metadata ?
- How to avoid it ?
I'm using Oracle Provider for OLE DB 12.1 64 bits and SQL Server 2017.
Microsoft SQL Server ODBC 17 Unknown token received from SQL Server
I'm using ODBC version 17 to connect to SQL Server 2016, but keep getting an error message "Unknown token received from SQL Server." The error logs does not give much information. ODBC is set to use Windows Authentication for SQL connections.
Has anyone faced this issue and solved it? Any help is much appreciated!
Thanks,
SQL Server 2017 Express Issue with 3 Tier database access.
Hi, I am facing an issue with SQL Server 2017 Express.
My client is on PC1, SQL server is configured on PC2 and the database is on PC3. I could successfully connect to SQL server on PC2 through client on PC1, but if I try to access the database on PC 3 using client on PC1, I get following error...
"Msg 5120, Level 16, State 101, Line 2
Unable to open the physical file "\\MD1Z549C.ad001.siemens.net\Database_DT\Products\ProductDB.mdf". Operating system error 5: "5(Access is denied.)".
Msg 1802, Level 16, State 7, Line 2
CREATE DATABASE failed. Some file names listed could not be created. Check related errors."
When i access the database on PC2 there is no Issue. or if i use other SQL server from PC1 then I could access database database on PC3 as well. (here no intermediate PC2 is used)
So issue is when I have Client, SQL Server and Database on 3 different machines. (it gives above errro message)
The same scenario used to work well with SQL server 2008 R2 Express.
The same issue is reproducible with SQL server 2017 full version and SQL server 2019.
All the three PCs, shared drives and SQL server are configured well, which used to work with SQL server 2008 R2 express.
Is there any limitation or restriction introduced with the latest version of SQL server ? OR anything I need to try out to make the scenario work on three different machine.
Thanks a lot in advance.
Regards,
Anil
Access the inner parameter of a parameter
Hi
How can I access the inner parameter of a parameter? example
With vCMD
.ActiveConnection = vSQL
.CommandType = adCmdStoredProc
.CommandText = "spDistribution_DRCancellationNewProcess"
.CommandTimeout = 0
.Parameters("@pOption").Value = 5
.Parameters("@parameter1").Value = N
.Parameters("@parameter1").Value(N).("@parameter1.1").value = N --this
.Execute
End With
Please help me.
Thanks
un-time error '13 Type mismatch VBA MSSQL
Hi
Please help me with my problem.
What's wrong with my code?
I already check the data type of the column in the database but i'm returning with the run-time error '13 Type mismatch.
Here's my code:
vCMD.ActiveConnection = vSQL
'vCMD.CommandType = adCmdStoredProc
vCMD.CommandText = "UPDATE tblDistribution_DRCancellationRequests SET Remarks = @resquestedBy WHERE RequestID = 544"
vCMD.CreateParameter ("@resquestedBy"), "aa"
vCMD.Execute
Database Profile Name
Hi
How can I make a database profile name to test my program?
I want to make a request cancellation approval thru email for my program.
here's my snippet :
exec msdb.dbo.sp_send_dbmail
@profile_name='transdev.NDESS',
@recipients=@Approver,
@copy_recipients=@eResquestor,
@blind_copy_recipients=@eBCopy,
@subject=@eSubject,
@body=@tableHTML,
@body_format='html'
This profile name is recognized by the server but it has no effect.
Please help. urgent.
thanks
Run Time Error '2147217887 (80040e21) String data, Right Truncation
Hi,
I have a problem with my macro(outlook). It return an error when I'm replying an email.
Kindly refer to the code block below.
Please help me.
Regards,
Jerzon
Sub ProcessWsubject(ByRef pMailItem As Outlook.MailItem) Dim vSQL As New ADODB.Connection Dim vCMD As New ADODB.Command Dim vSenderAddress As String vSenderAddress = GetSenderEmail(pMailItem.SenderEmailAddress) ' Open connection to SQL Server vSQL.Open (mSQLConStr) With vCMD .ActiveConnection = vSQL .CommandType = adCmdStoredProc .CommandText = "spEmailWRSub" .CommandTimeout = 0 .Parameters("@UIDL").Value = pMailItem.EntryID .Parameters("@DateSend").Value = pMailItem.SentOn .Parameters("@SenderEmail").Value = vSenderAddress .Parameters("@Recipient").Value = "JOBarbacena@neltex.com" .Parameters("@vSubject").Value = pMailItem.Subject .Parameters("@EmailBody").Value = pMailItem.Body .Parameters("@Remarks").Value = "" .Execute --- the error pointing this after debug End With vSQL.Close End Sub
Object variable or with block variable not set
Dim counter As Integer counter = 1 On Error GoTo Err: Dim sapConn As Object 'Declare connection object Set sapConn = CreateObject("SAP.Functions") 'Create ActiveX object sapConn.Connection.User = "NELTEX_Batch" 'Specify user sapConn.Connection.Password = "p@s$w0rd@201303" 'Then password sapConn.Connection.Client = "100" 'Client sapConn.Connection.ApplicationServer = "192.168.1.87" 'Target server address sapConn.Connection.Language = "EN" 'Language code 'Finally, try to logon to the specified system and check if the connection established Err: If sapConn.Connection.Logon(0, True) <> True Then --this point is having the error ErrMessage = "E - Cannot Log on to SAP" 'Issue message if cannot logon Call SAP_Email(ErrMessage) Exit Function Else ErrMessage = "S - Logged on to SAP!" End If
Hi I have a problem with this. please help me