Can I connect to an ODBC database from a web-based application? - odbc

Is it possible to connect with an ODBC database from a web-based application? Or does the application have to be downloaded directly on the PC?

Yes, it is possible. For example, the odbc npm package is available for Node programs (and such a program could easily be the backend for a web application). The original ODBC design was intended to be an "open" API, independent of implementation concerns such as operating system and database.

Related

Can you connect to CosmosDB from SSAS (Tabular) using the ODBC driver for Cosmos?

I have followed the instructions for setting up a new ODBC connection to CosmosDB. I would like to use this ODBC connection in an SSAS tabular project but I don't see a way to do that. I am on SSDT 15.1. When I click the "Others" data source for OLEDB/ODBC in SSAS, it only gives me build options for OLEDB. It's not clear how I would use this to connect to my CosmosDB ODBC.
Has anyone figured out how to do this? According to Microsoft it is possible but they have no instructions for it.
It is possible. Launch the "ODBC Data Sources (32-bit)" app and setup a system DSN as described in this article. Then open "ODBC Data Sources (64-bit)" and setup a system DSN with the exact same name as the 32-bit DSN. The reason is that Visual Studio is 32-bit so when performing some steps it requires a 32-bit driver, but once SSAS loads the table into memory that occurs in a 64-bit process which requires the 64-bit driver. Setup these DSNs on your workstation and on the workspace server (local if using the integrated workspace or on a dev server if using a remote workspace).
Using ODBC drivers inside Analysis Services Tabular doesn't seem to be very well documented. Basically you need to use the OLEDB for ODBC driver.
When creating a new connection in Visual Studio in your SSAS model, instead of choosing the driver from the dropdown, just type in the following connection string:
Provider=MSDASQL;DSN=YourDsnNameHere
If you prefer inline connection strings that make deploying easier to do without ODBC DSNs then you can use this connection string:
Provider=MSDASQL;DRIVER={Microsoft DocumentDB ODBC Driver};Host="https://yourcosmosdbname.documents.azure.com:443/";AuthenticationKey="authKeyHere!";LocalSchemaFile="c:\folder\yourCosmosSchema.json";KeyEncrypted=true;NumberOfRetries=5;DSNType=0;Consistency=1
Regardless of which connection string you will probably have to write a query such as select * from CollectionName rather than picking from the table list.
If you are using 1400 compatibility level models (Analysis Services 2017 or Azure Analysis Services) then you should consider using the modern get data experience which has native Cosmos DB integration that's a lot more polished.

SQL Server edition for desktop application with no network

I have been tasked with building an application for a Windows laptop that engineers can take out into the field where there is no internet access. Then, they will add data through a form and once they get back and have internet access, they can then hit a "Sync" button and send the data they collected to an external SQL Server database.
The database is SQL Server 2016 and the application is going to be a C# .NET desktop application. My question is what options are available for the database when there is no internet access? I don't really want to do Excel or Access. I really like SQL Server Compact but it seems dated. Is SQL Server Compact still relevant with the latest .NET Framework or is there something newer that everyone uses?
You could try creating a ssis package that syncs data between the offline database and live database.
The ssis package can be executed either as a sql server job that runs at intervals
or
from a stored procedure . Please find the below link on how to execute a package from stored procedure.
https://msdn.microsoft.com/en-us/library/jj820152.aspx
The stored procedure can then be called from inside the application.

Making an installer for a web app with database and a windows service

I want to make an installer for a client which installs
a web app on IIS
a mssql db
a window service
I am totally naive to thinking of the solution for this automated deployment through an installer (msi or exe). The installer may hint the user for prerequisites for example MSSQL server and upgrading/installing IIS before the web app installation can proceed. Is it possible?
Yes, it is possible. You need to first select in an authoring tool for Windows Installer. Some examples are Windows Installer XML (WiX) and InstallShield (various editions from free to pricey). You'll have some kind of EXE bootstarpper/chainer where you can handle prerequisite installation such as windows features and database engines. Or you can choose to simply ship an MSI that detects and blocks if these are missing and put the effort on the user to manage their baseline environment. The actual MSI will then likely have features for web, service and sql. The web feature will install a bunch of files and configure the IIS meta. The windows service will install some files and create a windows service. The SQL feature will ask for connection string information, execute some sql scripts and possibly configure the web and service layers' connection strings.
Some of this can be deferred until after the installation and placed into a custom configuration utility to simplify the installer work.
There are various design decisions that can be made so it can't be answered in more detail in a simple question format.

Advice required: Creating desktop application with database connectivity

I want to create a desktop application, I normally work on web based applications so have very little knowledge about creating console applications using .Net and visual studio.
So now in this application I'l also be using database connectivity and stored procedures (SQL server). But how should I start doing this as I dont want to install SQL server on my clients system.
thanks in advance..
I think it depends on the goal of your application, the amout and sturcture of the data and the environment. The last point aims to the client system, if the client is part of an enterprise network (e.g. Active Directory) or is a common user at home.
maybe you can use xml or json files to store the data
if you need a database, you can create a setup project for your application which automatically installs a SQL Server express
another way is, if it's applicable for you, your application can consume a webservice which provide the data
you could use SQL Server compact http://msdn.microsoft.com/en-us/library/cc645984(v=sql.100).aspx or SQL Lite to embark your DB in your application without external dependencies.
Otherwise, if offline isn't a requirement, you could go the "cloud" way, with web APIs

Connect to Remote Oracle database from ASP.NET

My course requires me to connect to an Oracle database server at the university for my project. I am provided with a url (like oracle.xyz.edu) and username and password. How can I connect to the database from Visual Studio. I have only dealt with SQL Server 2008. I don't know how to go ahead with setting up the database. I tried to install Oracle Instant Client, but could not find a setup exe to install. The instant client download zip consists of a set of files. Where can I find the steps to connect to Oracle database from VS.
Do you need to use the Oracle Instant Client? Or would it be acceptable to you to download and install the full version of the Oracle client?
The full version of the Oracle client is generally what ought to be installed on a developer machine. The Instant Client is a very slimmed down version of the client that is designed for developers to distribute along with their Windows applications on machines that do not have or need any way to access the database other than via the application. As a developer, I'd strongly recommend the full version of the Oracle client if only because it includes various additional utilities like SQL*Plus and SQL*Loader.
The full Oracle client is available for download from OTN on the same page that the database is available. For example, the Oracle 11.2 client for 64-bit Windows is a 615 MB download on the OTN site.
Don't use ODBC. Use ODP.NET (Oracle's Instant Client) Oracle Data Provider for .NET. (Read technical notes in provided link.)

Resources